# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
656554 | definitelynotmee | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++98 | 4101 ms | 24112 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 mp make_pair
#define mt make_tuple
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
using namespace std;
template <typename T>
using matrix = vector<vector<T>>;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INFL = (1LL<<62)-1;
const int INF = (1<<30)-1;
const double EPS = 1e-7;
const int MOD = 1e9 + 7;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
const int MAXN = 1e6+1;
vector<int> v;
int encode (int n, int x, int y) {
if(v.size() == 0){
v.resize(n+1);
int val = (1<<6)-1;
for(int i = 1; i <= n; i++){
int id = 0;
while(__builtin_popcount(val) != 6){
val|=1<<id;
id++;
}
v[i] = val;
val+=1<<__builtin_ctz(val);
}
}
for(int i = 0; i < 12; i++){
if(bool(v[x]&(1<<i)) && !bool(v[y]&(1<<i)))
return i+1;
}
}
#include<bits/stdc++.h>
using namespace std;
vector<int> v;
int decode (int n, int q, int h) {
h--;
if(v.size() == 0){
v.resize(n+1);
int val = (1<<6)-1;
for(int i = 1; i <= n; i++){
int id = 0;
while(__builtin_popcount(val) != 6){
val|=1<<id;
id++;
}
v[i] = val;
val+=1<<__builtin_ctz(val);
}
}
return bool(v[q]&(1<<h));
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |