Submission #164893

#TimeUsernameProblemLanguageResultExecution timeMemory
164893arnold518Question (Grader is different from the original contest) (CEOI14_question_grader)C++14
100 / 100
1816 ms112576 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; static vector<int> V; int encode(int N, int X, int Y) { int i, j; if(V.empty()) { V.push_back(-1); for(i=0; i<(1<<12); i++) if(__builtin_popcount(i)==6) V.push_back(i); } X=V[X]; Y=V[Y]; for(i=0; i<12; i++) if(X&(1<<i) && !(Y&(1<<i))) return i+1; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; static vector<int> V; int decode(int N, int Q, int H) { int i, j; H--; if(V.empty()) { V.push_back(-1); for(i=0; i<(1<<12); i++) if(__builtin_popcount(i)==6) V.push_back(i); } Q=V[Q]; if(Q&(1<<H)) return 1; else return 0; }

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:12:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j;
            ^
encoder.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

decoder.cpp: In function 'int decode(int, int, int)':
decoder.cpp:12:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j; H--;
            ^
#Verdict Execution timeMemoryGrader output
Fetching results...