# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151055 | Alexa2001 | Lokahian Relics (FXCUP4_lokahia) | C++17 | 3 ms | 632 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |