# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
837187 | Andrey | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 7085 ms | 2504 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> ans(12);
vector<int> wut(12);
int p = 0;
void dfs(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;
}
dfs(d+1,x,br);
wut[d] = 1;
dfs(d+1,x,br+1);
wut[d] = 0;
}
int encode (int n, int x, int y) {
p = 0;
dfs(0,x,0);
vector<int> a(12);
for(int i = 0; i < 12; i++) {
a[i] = ans[i];
}
p = 0;
dfs(0,y,0);
for(int i = 0; i < 12; i++) {
if(ans[i] == 0 && a[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... |