Submission #837192

#TimeUsernameProblemLanguageResultExecution timeMemory
837192AndreyQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
100 / 100
2482 ms24292 KiB
#include<bits/stdc++.h> using namespace std; int yoo[950][12]; int p = 0; vector<int> wut(12); void dfs(int d, int br) { if(d == 12 && br == 6) { p++; for(int i = 0; i < 12; i++) { yoo[p][i] = wut[i]; } return; } else if(d == 12) { return; } dfs(d+1,br); wut[d] = 1; dfs(d+1,br+1); wut[d] = 0; } int encode (int n, int x, int y) { if(p == 0) { dfs(0,0); } for(int i = 0; i < 12; i++) { if(yoo[x][i] == 1 && yoo[y][i] == 0) { return i+1; } } }
#include<bits/stdc++.h> using namespace std; int yoo[950][12]; int p = 0; vector<int> wut(12); void dfs(int d, int br) { if(d == 12 && br == 6) { p++; for(int i = 0; i < 12; i++) { yoo[p][i] = wut[i]; } return; } else if(d == 12) { return; } dfs(d+1,br); wut[d] = 1; dfs(d+1,br+1); wut[d] = 0; } int decode (int n, int q, int h) { if(p == 0) { dfs(0,0); } return yoo[q][h-1]; }

Compilation message (stderr)

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