# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
255483 | babo | 질문 (CEOI14_question_grader) | C++14 | 2231 ms | 48056 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
int encode(int n,int x,int y){
int i;
int xx[10]={};
int yy[10]={};
int xc[10]={};
int yc[10]={};
for(i=0;i<10;i++)
{
xx[i]=(x^(1<<i))?1:0;
yy[i]=(y^(1<<i))?1:0;
}
for(i=0;i<10;i++)
{
xc[i]=xx[i]!=xx[(i+1)%10]?1:0;
yc[i]=yy[i]!=yy[(i+1)%10]?1:0;
}
for(i=0;i<10;i++)
if(xc[i]&&!yc[i]) return i+1;
if(x==0) return 11;
return 12;
}
int decode(int n,int q,int h){
if(h==11) return q==0;
if(h==12) return q==1023;
int i;
int qq[10]={};
for(i=0;i<10;i++)
{
qq[i]=(q^(1<<i))?1:0;
}
return qq[h-1]!=qq[h%10];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |