Submission #815746

#TimeUsernameProblemLanguageResultExecution timeMemory
815746JakobZorzMinerals (JOI19_minerals)C++14
40 / 100
124 ms262144 KiB
#include"minerals.h" #include<iostream> #include<vector> using namespace std; int flag[50000]; int query(int a){ flag[a]++; flag[a]%=2; return Query(a); } void solve(vector<int>m){ //cout<<m.size()<<"\n"; if(m.size()==2){ Answer(m[0],m[1]); return; } int n=(int)m.size()/2; for(int i:m) if(query(i)>n/2) query(i); vector<int>m1,m2; for(int i:m){ if(flag[i]){ query(i); m1.push_back(i); }else m2.push_back(i); } solve(m1); solve(m2); } void Solve(int N){ vector<int>m; for(int i=1;i<=2*N;i++) m.push_back(i); solve(m); }
#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...