# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24558 | Bruteforceman | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++11 | 2669 ms | 27532 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 <int> v[1000];
void create() {
if(!v[1].empty()) return ;
int idx = 0;
for(int i = 0; i < (1 << 12); i++) {
if(__builtin_popcount(i) == 6) {
++idx;
for(int j = 0; j < 12; j++) {
if((i >> j) & 1) {
v[idx].push_back(j + 1);
}
}
}
}
}
int encode (int n, int x, int y) {
create();
set <int> s (v[y].begin(), v[y].end());
for(auto i : v[x]) {
if(s.find(i) == s.end()) return i;
}
return -1;
}
#include "bits/stdc++.h"
using namespace std;
vector <int> g[1000];
void generate() {
if(!g[1].empty()) return ;
int idx = 0;
for(int i = 0; i < (1 << 12); i++) {
if(__builtin_popcount(i) == 6) {
++idx;
for(int j = 0; j < 12; j++) {
if((i >> j) & 1) {
g[idx].push_back(j + 1);
}
}
}
}
}
int decode (int n, int q, int h) {
generate();
for(auto i : g[q]) {
if(i == h) return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |