// author : sentheta aka vanwij
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cassert>
#include<random>
#include<chrono>
#include<cmath>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
#define Int long long
#define V vector
#define pii pair<int,int>
#define ff first
#define ss second
#define pow2(x) (1LL<<(x))
#define msb(x) (63-__builtin_clzll(x))
#define bitcnt(x) (__builtin_popcountll(x))
#define nl '\n'
#define _ << ' ' <<
#define all(x) (x).begin(), (x).end()
#define rep(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define dbg(x) if(1) cout << "?" << #x << " : " << (x) << endl << flush;
V<int> a;
bool decode(int N, int q, int h) {
if(a.empty()){
rep(i,0,1<<12) if(bitcnt(i)==6){
a.push_back(i);
}
}
h--;
return a[q]>>h&1;
assert(0);
}
V<int> b;
int encode(int N, int x, int y) {
if(b.empty()){
rep(i,0,1<<12) if(bitcnt(i)==6){
b.push_back(i);
}
}
// dbg(b.size());
rep(i,0,12) if(!(b[x]>>i&1) && (b[y]>>i&1)){
return i+1;
}
assert(0);
}
// author : sentheta aka vanwij
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cassert>
#include<random>
#include<chrono>
#include<cmath>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
#define Int long long
#define V vector
#define pii pair<int,int>
#define ff first
#define ss second
#define pow2(x) (1LL<<(x))
#define msb(x) (63-__builtin_clzll(x))
#define bitcnt(x) (__builtin_popcountll(x))
#define nl '\n'
#define _ << ' ' <<
#define all(x) (x).begin(), (x).end()
#define rep(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define dbg(x) if(1) cout << "?" << #x << " : " << (x) << endl << flush;
V<int> a;
bool decode(int N, int q, int h) {
if(a.empty()){
rep(i,0,1<<12) if(bitcnt(i)==6){
a.push_back(i);
}
}
h--;
return a[q]>>h&1;
assert(0);
}
V<int> b;
int encode(int N, int x, int y) {
if(b.empty()){
rep(i,0,1<<12) if(bitcnt(i)==6){
b.push_back(i);
}
}
// dbg(b.size());
rep(i,0,12) if(!(b[x]>>i&1) && (b[y]>>i&1)){
return i+1;
}
assert(0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1986 ms |
24300 KB |
wrong answer |
2 |
Incorrect |
1769 ms |
24256 KB |
wrong answer |