# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34005 | ngkan146 | 즐거운 사진 수집 (JOI13_collecting) | C++98 | 2373 ms | 34784 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;
const int N = (1<<20) + 5;
int n,q,lgn;
int seg[2][4*N], sum[2][25];
void build(int id,int l,int r){
if (l == r){
seg[0][id] = seg[1][id] = 0;
return;
}
build(2*id,l,(l+r)/2);
build(2*id+1,(l+r)/2+1,r);
seg[0][id] = seg[1][id] = 0;
}
void upd(int type,int id,int l,int r,int pos,int layer){
if (r < pos || pos < l) return;
if (l == r){
seg[type][id] ^= 1;
return;
}
upd(type, 2*id, l, (l+r)/2, pos, layer+1);
upd(type, 2*id+1, (l+r)/2+1, r, pos, layer+1);
sum[type][layer] -= (seg[type][id] != -1);
if (seg[type][2*id] == -1 || seg[type][2*id+1] == -1)
seg[type][id] = -1;
else if (seg[type][2*id] != seg[type][2*id+1])
seg[type][id] = -1;
else
seg[type][id] = seg[type][2*id];
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... |