# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
19757 | | ainta | 동전 (kriii4_E) | C++98 | | 9 ms | 1212 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<stdio.h>
int D[32768];
void Do(int x, int pv, int s){
if(pv==15|| !(x&(1<<pv))){
if(!D[x^s])D[x]=1;
return;
}
Do(x,pv+1,s);
Do(x,pv+1,s|(1<<pv));
}
int main(){
int i, j, k, res, n;
D[0] = 0;
for(i=1;i<32768;i++){
for(j=0;j<15;j++){
if((1<<j)&i)Do(i,j+1,(1<<j));
}
}
/* for(i=1;i<=15;i++){
res = 0;
for(j=0;j<(1<<i);j++)if(D[j]==0)res++;
printf("%d\n",res);
}*/
scanf("%d",&n);
if(n<=15){
res = 0;
for(i=0;i<(1<<n);i++)if(D[i]==0)res++;
printf("%d\n",res);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |