# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132879 | Osama_Alkhodairy | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++17 | 1130 ms | 84976 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;
vector <vector <int> > all;
int encode (int n, int x, int y) {
x--; y--;
const int K = 12;
if(all.size() == 0){
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;
vector <vector <int> > all;
int decode (int n, int q, int h) {
h--; q--;
const int K = 12;
if(all.size() == 0){
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... |