# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26838 | baactree | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 2192 ms | 27608 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 <algorithm>
#include <vector>
using namespace std;
vector<int> perm[921];
bool flag=false;
int encode (int n, int x, int y) {
if(!flag){
flag=true;
for(int i=0;i<12;i++)
perm[1].push_back(i>5);
for(int i=2;i<921;i++){
perm[i]=perm[i-1];
next_permutation(perm[i].begin(),perm[i].end());
}
}
for(int i=0;i<12;i++)
if(perm[x][i]==1&&perm[y][i]==0)
return i+1;
return 0;
}
#include <algorithm>
#include <vector>
using namespace std;
vector<int> perm[921];
bool flag=false;
int decode (int n, int q, int h) {
if(!flag){
flag=true;
for(int i=0;i<12;i++)
perm[1].push_back(i>5);
for(int i=2;i<921;i++){
perm[i]=perm[i-1];
next_permutation(perm[i].begin(),perm[i].end());
}
}
return perm[q][h-1];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |