# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
44625 | MatheusLealV | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++17 | 1685 ms | 79240 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>
#define f first
#define s second
using namespace std;
typedef pair<int, int> pii;
int g = 0, Nmax = 0;
vector<int> v;
void gerar()
{
if(g) return;
for(int val = 1; val < (1<<12); val ++)
{
int l = 0, r = 0;
for(int bit = 0; bit < 12; bit ++)
{
if( (val & (1<<bit)) && bit >= 6) l++;
if( !(val & (1<<bit)) && bit < 6) r++;
}
if(l == r) v.push_back(val);
}
g = true;
}
int encode (int n, int x, int y)
{
gerar();
x = v[x], y = v[y];
for(int bit = 0; bit < 12; bit ++)
{
if( (x & (1<<bit)) && !(y & (1<<bit))) return bit + 1;
}
}
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef pair<int, int> pii;
int g = 0, Nmax = 0;
vector<int> v;
void gerar()
{
if(g) return;
for(int val = 1; val < (1<<12); val ++)
{
int l = 0, r = 0;
for(int bit = 0; bit < 12; bit ++)
{
if( (val & (1<<bit)) && bit >= 6) l++;
if( !(val & (1<<bit)) && bit < 6) r++;
}
if(l == r) v.push_back(val);
}
g = true;
}
int decode (int n, int q, int h)
{
gerar();
h--;
int val = v[q];
if(val & (1<<h)) return 1;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |