#include "lokahia.h"
int FindBase(int N){
int who = 0;
int cnt = 0;
for(int i=0; i<N; i++){
if(cnt == 0){
who = i;
cnt = 1;
continue;
}
int query = CollectRelics(who, i);
if(query == -1) cnt--;
else{
who = query;
cnt++;
}
}
cnt = 0;
for(int i=0; i<N; i++){
if(i != who && CollectRelics(who, i) == who) cnt++;
}
if(cnt >= N / 2) return who;
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
504 KB |
Wrong |
2 |
Incorrect |
3 ms |
504 KB |
Wrong |
3 |
Incorrect |
2 ms |
632 KB |
Wrong |
4 |
Correct |
2 ms |
632 KB |
Correct : C = 299 |
5 |
Incorrect |
2 ms |
504 KB |
Wrong |
6 |
Correct |
2 ms |
504 KB |
Correct : C = 225 |
7 |
Incorrect |
3 ms |
632 KB |
Wrong |
8 |
Partially correct |
2 ms |
504 KB |
Partially correct : C = 385 |
9 |
Correct |
2 ms |
504 KB |
Correct : C = 228 |
10 |
Incorrect |
2 ms |
504 KB |
Wrong |
11 |
Incorrect |
2 ms |
504 KB |
Wrong |
12 |
Correct |
2 ms |
632 KB |
Correct : C = 179 |
13 |
Incorrect |
3 ms |
504 KB |
Wrong |
14 |
Incorrect |
3 ms |
632 KB |
Wrong |
15 |
Partially correct |
2 ms |
504 KB |
Partially correct : C = 317 |
16 |
Correct |
2 ms |
376 KB |
Correct : C = 8 |
17 |
Partially correct |
2 ms |
632 KB |
Partially correct : C = 385 |
18 |
Incorrect |
2 ms |
504 KB |
Wrong |
19 |
Incorrect |
2 ms |
504 KB |
Wrong |
20 |
Partially correct |
2 ms |
504 KB |
Partially correct : C = 310 |
21 |
Incorrect |
3 ms |
504 KB |
Wrong |
22 |
Correct |
2 ms |
376 KB |
Correct : C = 0 |
23 |
Incorrect |
2 ms |
504 KB |
Wrong |
24 |
Correct |
2 ms |
504 KB |
Correct : C = 297 |
25 |
Incorrect |
2 ms |
504 KB |
Wrong |
26 |
Incorrect |
2 ms |
632 KB |
Wrong |
27 |
Correct |
2 ms |
504 KB |
Correct : C = 177 |