Submission #451567

#TimeUsernameProblemLanguageResultExecution timeMemory
451567kingfran1907Question (Grader is different from the original contest) (CEOI14_question_grader)C++14
0 / 100
7015 ms940 KiB
#include <bits/stdc++.h> using namespace std; int encode (int n, int x, int y) { vector< int > v; for (int i = 0; i < 6; i++) v.push_back(0); for (int i = 0; i < 6; i++) v.push_back(1); vector< set< int > > vs; do { set< int > tren; for (int i = 0; i < 12; i++) { if (v[i] == 1) tren.insert(i); } vs.push_back(tren); } while (next_permutation(v.begin(), v.end())); for (auto iter : vs[x]) { if (vs[y].count(iter) == 0) return iter + 1; } }
#include <bits/stdc++.h> using namespace std; int decode (int n, int q, int h) { vector< int > v; for (int i = 0; i < 6; i++) v.push_back(0); for (int i = 0; i < 6; i++) v.push_back(1); vector< set< int > > vs; do { set< int > tren; for (int i = 0; i < 12; i++) { if (v[i] == 1) tren.insert(i); } vs.push_back(tren); } while (next_permutation(v.begin(), v.end())); h--; return vs[q].count(h); }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:5:16: warning: control reaches end of non-void function [-Wreturn-type]
    5 |  vector< int > v;
      |                ^
#Verdict Execution timeMemoryGrader output
Fetching results...