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