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"
#include<bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
void Solve(int N) {
vector<int> v(N*2+1,-1);
vector<bitset<30001>> rec(100);
for(int t=0;t<100;t++){
vector<int> idx(N*2);
iota(idx.begin(),idx.end(),1);
shuffle(idx.begin(),idx.end(),rnd);
int a=0;
for(int j=0;j<N*2;j++){
int i=idx[j];
int b=Query(i);
if(b==a){
Query(i);
}
else{
a=b;
rec[t][i]=1;
}
}
for(int j=0;j<N*2;j++){
int i=idx[j];
if(rec[t][i]==1){
Query(i);
}
}
}
for(int i=1;i<=N*2;i++){
bitset<30001> tmp;
for(int j=0;j<100;j++){
if(rec[j][i]){
tmp|=rec[j];
}
}
for(int j=i+1;j<=N*2;j++){
if(tmp[j]==0){
Answer(i,j);
}
}
}
}
# | 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... |