#include "wombats.h"
#include<bits/stdc++.h>
#define lsb(x) (x &(-x))
using namespace std;
const int N = 5005;
int n, m, fwk[N];
void upd (int idx, int val) {
for (idx++; idx < N; idx += lsb(idx)) fwk[idx] += val;
}
int qr (int idx) {
int res = 0;
for (idx++; idx; idx -= lsb(idx)) res += fwk[idx];
return res;
}
void init(int R, int C, int H[5000][200], int V[5000][200]) {
n = R; m = C;
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < m; j++) upd(i + 1, V[i][j]);
}
}
void changeH(int P, int Q, int W) {
}
void changeV(int P, int Q, int W) {
int cur = qr(P + 1) - qr(P);
upd(P + 1, -cur); upd(P + 1, W);
}
int escape(int V1, int V2) {
return qr(n - 1);
}
Compilation message
grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
15 | int res;
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
4700 KB |
Output is correct |
2 |
Correct |
1 ms |
4700 KB |
Output is correct |
3 |
Correct |
38 ms |
7504 KB |
Output is correct |
4 |
Correct |
1 ms |
4700 KB |
Output is correct |
5 |
Correct |
1 ms |
4700 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
8284 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |