# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
158465 | maruii | 조개 줍기 (KOI17_shell) | C++14 | 201 ms | 31292 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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];
void up(int x, int y, int c) {
while (1) {
if (c > 0) while (y + 1 <= N && fen[x].query(y + 1) == fen[x].query(y) + A[x][y + 1]) y++;
else while (y + 1 <= N && fen[x].query(y + 1) != fen[x - 1].query(y + 1) + A[x][y + 1]) y++;
ye[x] = y;
if (x == N || (c > 0 && fen[x + 1].query(y) != fen[x].query(y) + A[x + 1][y]) || (c < 0 && fen[x + 1].query(y) != fen[x + 1].query(y - 1) + A[x + 1][y])) break;
x++;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |