# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
12971 | dohyun0324 | 즐거운 사진 수집 (JOI13_collecting) | C++98 | 0 ms | 36244 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
int r,t,n,q,cnt[2][21],pos[3000010],sw,dap[21],tree[2][3000010],hap[21];
int update(int p,int s,int x,int y,int k)
{
if(x==y)
{
if(tree[p][k]==0){tree[p][k]=1; return 1;}
else{tree[p][k]=0; return -1;}
}
if(tree[p][k]==0 || tree[p][k]==1<<pos[k])
{
cnt[p][pos[k]]--;
cnt[p][pos[k*2]]+=2;
}
if(s<=(x+y)/2) tree[p][k]=tree[p][k]+update(p,s,x,(x+y)/2,k*2);
else tree[p][k]=tree[p][k]+update(p,s,(x+y)/2+1,y,k*2+1);
if(tree[p][k]==0)
{
cnt[p][pos[k*2]]--;
sw=1;
r=k;
}
}
void pro()
{
int i,sum=0,ans=0;
for(i=n;i>=0;i--){
sum+=(1<<i)*cnt[0][i];
dap[i]=sum/(1<<i)*cnt[1][i];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |