# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
158479 | maruii | 조개 줍기 (KOI17_shell) | C++14 | 619 ms | 35748 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int N, f[1505][1505], A[1505][1505], ys[1505], ye[1505];
struct BIT {
int A[1505];
void update(int x, int v) {
x++;
for (; x; x -= x & -x) A[x] += v;
}
void update(int s, int e, int v) {
update(e, v);
update(s - 1, -v);
}
int query(int x) {
x++;
int ret = 0;
for (; x < 1505; x += x & -x) ret += A[x];
return ret;
}
} fen[1505];
inline int query(int x, int y) { return f[x][y] + fen[x].query(y); }
void up(int x, int y, int c) {
ye[x] = y;
while (1) {
int t = 0;
if ((c > 0 && y < N && query(x, y + 1) == query(x, y) + A[x][y + 1]) || (c < 0 && y < N && query(x, y + 1) != query(x - 1, y + 1) + A[x][y + 1])) y++;
else x++;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |