Submission #710394

#TimeUsernameProblemLanguageResultExecution timeMemory
710394Darren0724Minerals (JOI19_minerals)C++17
0 / 100
4 ms464 KiB
#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(33); for(int t=0;t<33;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<33;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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...