Submission #250110

#TimeUsernameProblemLanguageResultExecution timeMemory
250110cheehengMinerals (JOI19_minerals)C++14
40 / 100
37 ms3224 KiB
#include "minerals.h" #include <bits/stdc++.h> using namespace std; void rec(vector<int> list1, vector<int> list2){ int size1 = (int)list1.size(); if(size1 == 1){ Answer(list1[0], list2[0]); return; } int M = size1/2; vector<int> list3; for(int i = 0; i < M; i ++){ list3.push_back(list1[i]); Query(list1[i]); } vector<int> list5; for(int i = M; i < size1; i ++){ list5.push_back(list1[i]); } vector<int> list4; vector<int> list6; for(int i = 0; i < size1; i ++){ int temp = Query(list2[i]); if(temp == M){ list4.push_back(list2[i]); }else{ list6.push_back(list2[i]); } Query(list2[i]); } for(int i = 0; i < M; i ++){ Query(list1[i]); } rec(list3, list4); rec(list5, list6); return; } void Solve(int N) { int curUnique = 0; vector<int> list1; vector<int> list2; for(int i = 1; i <= 2*N; i ++){ int temp = Query(i); if(temp > curUnique){ list1.push_back(i); }else{ list2.push_back(i); } curUnique = temp; } /* for(int i: list1){ printf("%d\n", i); } */ for(int i = 1; i <= 2*N; i ++){ Query(i); } rec(list1, list2); }
#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...