# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
189100 | TadijaSebez | 질문 (CEOI14_question_grader) | C++11 | 1593 ms | 106224 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 <assert.h>
int encode (int n, int x, int y) {
for(int i=0;i<10;i++)
{
if((x>>i&1) && !(y>>i&1)) return i+1;
}
int sum=0;
for(int i=0;i<10;i++) sum+=x>>i&1;
return 10+sum;
return -1;
/*for(int step=1;step<=10;step++)
{
int a=0,b=0;
for(int i=0;i<10;i+=step)
{
a^=x>>i&1;
b^=y>>i&1;
}
if(a!=b) return (step-1)*2+a+1;
}
assert(0);
return -1;*/
}
int decode (int n, int q, int h) {
h--;
if(h<10)
{
if(q>>h&1) return 1;
else return 0;
}
else
{
h-=9;
int sum=0;
for(int i=0;i<10;i++) sum+=q>>i&1;
if(sum==h) return 1;
else return 0;
}
/*int step=h/2+1,a=0;
for(int i=0;i<10;i+=step) a^=q>>i&1;
if(a==h%2) return 1;
else return 0;*/
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |