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 "minerals.h"
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define REP(i,j,k) for(int i=(j);i<(k);++i)
#define RREP(i,j,k) for(int i=int(j)-1;i>=(k);--i)
#define pb push_back
// #define __debug
#ifdef __debug
#define pr(...) cerr<<__VA_ARGS__
#define ar(a,s,t) {rep(zy,s,t)pr(a[zy]<<' ');pr(endl);}
#else
#define pr(...) (void)0
#define ar(...) (void)0
#endif
//
const int maxn=43009;
bitset<2*maxn>bs;
int ls=0,res[2*maxn];
int qr(int x){
int t=Query(x+1);
swap(t,ls);
return ls==t;
}
void Solve(int n){
REP(i,0,2*n)qr(i);
REP(i,0,16){
bs.reset();
REP(j,0,2){
REP(k,0,2*n){
if((k>>i)%2==j){
if(!qr(k))bs[k]=1;
}
}
REP(k,0,2*n){
if((k>>i)%2==j){
if(!qr(k))bs[k]=1;
}
}
}
REP(j,0,2*n)res[j]|=(!bs[j])<<i;
}
REP(i,0,2*n)if(i<(i^res[i]))Answer(i+1,(i^res[i])+1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |