# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
837190 | Andrey | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 7096 ms | 4404 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;
vector<int> ans1(12);
vector<int> ans2(12);
vector<int> wut(12);
int p = 0;
void dfs(int d, int x, int y, int br) {
if(d == 12 && br == 6) {
p++;
if(x == p) {
for(int i = 0; i < 12; i++) {
ans1[i] = wut[i];
}
}
if(y == p) {
for(int i = 0; i < 12; i++) {
ans2[i] = wut[i];
}
}
return;
}
else if(d == 12) {
return;
}
dfs(d+1,x,y,br);
wut[d] = 1;
dfs(d+1,x,y,br+1);
wut[d] = 0;
}
int encode (int n, int x, int y) {
p = 0;
dfs(0,x,y,0);
for(int i = 0; i < 12; i++) {
if(ans2[i] == 0 && ans1[i] == 1) {
return i+1;
}
}
}
#include<bits/stdc++.h>
using namespace std;
vector<int> ans(12);
vector<int> wut(12);
int p = 0;
void dude(int d, int x, int br) {
if(d == 12 && br == 6) {
p++;
if(x == p) {
for(int i = 0; i < 12; i++) {
ans[i] = wut[i];
}
}
return;
}
else if(d == 12) {
return;
}
dude(d+1,x,br);
wut[d] = 1;
dude(d+1,x,br+1);
wut[d] = 0;
}
int decode (int n, int q, int h) {
p = 0;
h--;
dude(0,q,0);
return ans[h];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |