# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320276 | tasfiq4 | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 4343 ms | 24740 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;
bool am=false;
int code[922][12];
int perm[12]={0,0,0,0,0,0,1,1,1,1,1,1};
int encode(int n,int x,int y){
//printf("x %d y %d\n",x,y);
int i,cnt=0;
if(!am)
{
do{
for(i=0;i<12;i++)
code[cnt][i]=perm[i];
cnt++;
}while(next_permutation(perm,perm+12));
am=true;
}
x--;y--;
for(i=0;i<12;i++)
if(code[x][i]&&!code[y][i]) return i+1;
}
#include <bits/stdc++.h>
using namespace std;
bool am=false;
int code[922][12];
int perm[12]={0,0,0,0,0,0,1,1,1,1,1,1};
int decode(int n,int q,int h){
int i,cnt=0;
q--;
if(!am)
{
do{
for(i=0;i<12;i++)
code[cnt][i]=perm[i];
cnt++;
}while(next_permutation(perm,perm+12));
am=true;
}
return code[q][h-1];
//printf("h %lld\n",h);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |