#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+1)/2) return -1;
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
632 KB |
Correct : C = 236 |
2 |
Correct |
3 ms |
504 KB |
Correct : C = 225 |
3 |
Correct |
2 ms |
504 KB |
Correct : C = 177 |
4 |
Correct |
3 ms |
508 KB |
Correct : C = 111 |
5 |
Incorrect |
2 ms |
632 KB |
Wrong |
6 |
Correct |
2 ms |
504 KB |
Correct : C = 229 |
7 |
Correct |
2 ms |
504 KB |
Correct : C = 224 |
8 |
Incorrect |
2 ms |
376 KB |
Wrong |
9 |
Partially correct |
3 ms |
632 KB |
Partially correct : C = 384 |
10 |
Partially correct |
3 ms |
632 KB |
Partially correct : C = 385 |
11 |
Correct |
2 ms |
632 KB |
Correct : C = 228 |
12 |
Correct |
3 ms |
504 KB |
Correct : C = 297 |
13 |
Partially correct |
3 ms |
532 KB |
Partially correct : C = 396 |
14 |
Correct |
2 ms |
504 KB |
Correct : C = 8 |
15 |
Partially correct |
3 ms |
632 KB |
Partially correct : C = 389 |
16 |
Correct |
3 ms |
504 KB |
Correct : C = 191 |
17 |
Partially correct |
3 ms |
632 KB |
Partially correct : C = 385 |
18 |
Partially correct |
3 ms |
504 KB |
Partially correct : C = 385 |
19 |
Partially correct |
3 ms |
632 KB |
Partially correct : C = 317 |
20 |
Partially correct |
2 ms |
504 KB |
Partially correct : C = 398 |
21 |
Correct |
2 ms |
632 KB |
Correct : C = 100 |
22 |
Partially correct |
3 ms |
504 KB |
Partially correct : C = 380 |
23 |
Correct |
3 ms |
632 KB |
Correct : C = 60 |
24 |
Partially correct |
3 ms |
504 KB |
Partially correct : C = 398 |
25 |
Partially correct |
3 ms |
504 KB |
Partially correct : C = 396 |
26 |
Correct |
2 ms |
632 KB |
Correct : C = 236 |
27 |
Correct |
2 ms |
504 KB |
Correct : C = 238 |