Submission #99301

#TimeUsernameProblemLanguageResultExecution timeMemory
99301MercenaryICC (CEOI16_icc)C++14
0 / 100
6 ms640 KiB
//#ifndef __GRADER_CPP__ //#define __GRADER_CPP__ // //#include "graderlib.cpp" #include "icc.h" #include <bits/stdc++.h> const int maxn = 105; using namespace std; vector<int> P[maxn]; int papa[maxn]; int Cal(vector<int> a , vector<int> b) { int n = a.size(); if(n == 1)return a[0]; vector<int> tmp; int mid = n / 2; for(int i = 0 ; i < mid ; ++i)tmp.push_back(a[i]); if(query(tmp.size(),b.size(),tmp.data(),b.data())){ return Cal(tmp,b); } tmp.clear(); for(int i = mid ; i < n ; ++i)tmp.push_back(a[i]); return Cal(tmp,b); } void run(int n) { for(int i = 1 ; i <= n ; ++i)P[i].push_back(i) , papa[i] = i; for(int i = n ; i > 1 ; --i) { vector<int> a , b; for(int j = 0 ; j < 10 ; ++j) { for(int k = 1 ; k <= i ; ++k) { if((k >> j) & 1)for(int c : P[k])a.push_back(c); else for(int c : P[k])b.push_back(c); } if(query(a.size(),b.size(),a.data(),b.data()))break; } int u = Cal(a , b); int v = Cal(b , a); setRoad(u,v); u = papa[u]; v = papa[v]; if(u > v)swap(u,v); for(int c : P[v])papa[c] = u , P[u].push_back(c); swap(P[v],P[i]); } } //int main() { // using namespace ceoi_2016; // InitGrader(); // // run(NumVertices()); // // GraderExitFail(); // printf("SUCCESS"); // return 0; //} // //#endif // __GRADER_CPP__
#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...