# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
198409 | tincamatei | 즐거운 사진 수집 (JOI13_collecting) | C++14 | 2282 ms | 52900 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 20;
long long quadFullNodes;
int cnt[2][(1 << (MAX_N + 1))];
int fullNodes[2][1+MAX_N];
void update(int aint, int poz, int dep, int l, int r, int nod = 1) {
if(r < l || poz < l || r < poz) return;
if(cnt[aint][nod] == 0 || cnt[aint][nod] == r - l + 1) {
quadFullNodes -= fullNodes[1-aint][dep];
fullNodes[aint][dep]--;
}
if(l < r) {
int mid = (l + r) / 2;
update(aint, poz, dep + 1, l, mid, 2 * nod);
update(aint, poz, dep + 1, mid + 1, r, 2 * nod + 1);
cnt[aint][nod] = cnt[aint][2 * nod] + cnt[aint][2 * nod + 1];
} else
cnt[aint][nod] ^= 1;
if(cnt[aint][nod] == 0 || cnt[aint][nod] == r - l + 1) {
quadFullNodes += fullNodes[1-aint][dep];
fullNodes[aint][dep]++;
}
컴파일 시 표준 에러 (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... |