Submission #151055

#TimeUsernameProblemLanguageResultExecution timeMemory
151055Alexa2001Lokahian Relics (FXCUP4_lokahia)C++17
0 / 100
3 ms632 KiB
#include "lokahia.h" #include <bits/stdc++.h> using namespace std; int FindBase(int n) { int i; // vector<int> good; int cnt = 0, who; for(i=0; i<n; ++i) { if(cnt == 0) { // good.clear(); who = i; cnt = 1; } else if(CollectRelics(who, i) != -1) ++cnt;//, good.push_back(i); else --cnt; } if(!cnt) return -1; cnt = 0; int ans = n; for(i=0; i<n; ++i) if(i == who) ++cnt; else { int act = CollectRelics(who, i); if(act == -1) continue; ans = min(ans, act); ++cnt; } if(cnt < n/2) return -1; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...