Submission #150603

# Submission time Handle Problem Language Result Execution time Memory
150603 2019-09-01T08:42:41 Z rkm0959(#3623, jun6873, babo) Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
7 ms 640 KB
#include "lokahia.h"



int FindBase(int N) {
    int cand = (N%2) ? N-1 : -1, k;
    for (int i=0; i+1<N; i+=2) if ((k = CollectRelics(i, i+1)) != -1) cand = k;

    if (cand == -1) return -1;

    int cnt = 1;
    for (int i=0; i<N; i++) if (i != cand) cnt += (CollectRelics(cand, i) != -1);

    if (cnt > N/2) return cand;
    return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 512 KB Correct : C = 177
2 Correct 6 ms 640 KB Correct : C = 100
3 Correct 7 ms 640 KB Correct : C = 299
4 Correct 7 ms 512 KB Correct : C = 177
5 Correct 7 ms 640 KB Correct : C = 299
6 Correct 7 ms 640 KB Correct : C = 299
7 Correct 6 ms 640 KB Correct : C = 297
8 Correct 6 ms 512 KB Correct : C = 179
9 Correct 7 ms 640 KB Correct : C = 297
10 Correct 6 ms 640 KB Correct : C = 299
11 Correct 6 ms 640 KB Correct : C = 299
12 Incorrect 6 ms 640 KB Wrong
13 Correct 7 ms 512 KB Correct : C = 179
14 Correct 6 ms 640 KB Correct : C = 299
15 Correct 7 ms 640 KB Correct : C = 297
16 Correct 6 ms 512 KB Correct : C = 60
17 Correct 6 ms 640 KB Correct : C = 297
18 Correct 6 ms 640 KB Correct : C = 299
19 Correct 6 ms 512 KB Correct : C = 177
20 Correct 7 ms 512 KB Correct : C = 0
21 Correct 5 ms 384 KB Correct : C = 6
22 Correct 6 ms 512 KB Correct : C = 177
23 Correct 5 ms 512 KB Correct : C = 177
24 Correct 5 ms 512 KB Correct : C = 179
25 Correct 6 ms 640 KB Correct : C = 297
26 Correct 6 ms 640 KB Correct : C = 297
27 Correct 6 ms 512 KB Correct : C = 179