# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132875 | Osama_Alkhodairy | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++17 | 7088 ms | 1436 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;
int encode (int n, int x, int y) {
x--; y--;
const int K = 12;
vector <vector <int> > all;
for(int i = 0 ; i < (1 << K) ; i++){
if(__builtin_popcount(i) != K / 2) continue;
vector <int> cur;
for(int j = 0 ; j < K ; j++){
if((i >> j) & 1) cur.push_back(j);
}
all.push_back(cur);
}
for(auto &i : all[x]){
if(count(all[y].begin(), all[y].end(), i)) continue;
return i + 1;
}
assert(false);
}
#include <bits/stdc++.h>
using namespace std;
int decode (int n, int q, int h) {
h--; q--;
const int K = 12;
vector <vector <int> > all;
for(int i = 0 ; i < (1 << K) ; i++){
if(__builtin_popcount(i) != K / 2) continue;
vector <int> cur;
for(int j = 0 ; j < K ; j++){
if((i >> j) & 1) cur.push_back(j);
}
all.push_back(cur);
}
for(auto &i : all[q]){
if(i == h) return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |