Submission #837190

#TimeUsernameProblemLanguageResultExecution timeMemory
837190AndreyQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
0 / 100
7096 ms4404 KiB
#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)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...