Submission #541465

# Submission time Handle Problem Language Result Execution time Memory
541465 2022-03-23T16:26:39 Z eecs Weirdtree (RMI21_weirdtree) C++17
5 / 100
2000 ms 5800 KB
#include "weirdtree.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn = 300010;
int n, h[maxn];

void initialise(int _n, int, int *_h) {
    n = _n, copy(_h + 1, _h + n + 1, h + 1);
}

void cut(int l, int r, int k) {
    while (k--) {
        int i = max_element(h + l, h + r + 1) - h;
        if (!h[i]) break;
        h[i]--;
    }
}

void magic(int i, int x) {
	h[i] = x;
}

ll inspect(int l, int r) {
	return accumulate(h + l, h + r + 1, 0LL);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Execution timed out 2064 ms 3268 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2079 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2079 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2007 ms 5800 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Execution timed out 2064 ms 3268 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Execution timed out 2064 ms 3268 KB Time limit exceeded
4 Halted 0 ms 0 KB -