Submission #1072670

#TimeUsernameProblemLanguageResultExecution timeMemory
1072670boyliguanhanMinerals (JOI19_minerals)C++17
40 / 100
18 ms3160 KiB
#include "minerals.h" #include<bits/stdc++.h> using namespace std; void solve(vector<int>A,vector<int>B){ if(A.size()==1) return Answer(A[0],B[0]); vector<int>A1,A2; vector<int>B1,B2; for(auto i:A) A1.push_back(i),swap(A1,A2); int prv=0; for(auto i:A1) prv=Query(i); for(auto i:B) { int x=Query(i); if(x==prv) B2.push_back(i); else B1.push_back(i); prv=x; } for(auto i:A1) Query(i); for(auto i:B) Query(i); solve(A1,B1); solve(A2,B2); } void Solve(int N) { vector<int>A,B; int prv=0; for(int i=1;i<=2*N;i++) if(Query(i)!=prv) A.push_back(i),prv++; else B.push_back(i); solve(A,B); }
#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...