Submission #150798

# Submission time Handle Problem Language Result Execution time Memory
150798 2019-09-01T08:56:39 Z rkm0959(#3623, jun6873, babo) Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
7 ms 640 KB
#include "lokahia.h"
#include <bits/stdc++.h>
using namespace std;

int FindBase(int N) {
    srand(20001021);

    vector<int> ans;

    int k;
    for (int i=0; i+1<N; i+=2) if ((k = CollectRelics(i, i+1)) != -1) ans.push_back(k);

    if (N%2 and ans.empty()) ans.push_back(N-1);
    
    if (ans.empty()) return -1;

    int cand = ans[rand() % ans.size()];

    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 640 KB Correct : C = 177
2 Correct 7 ms 600 KB Correct : C = 299
3 Correct 6 ms 640 KB Correct : C = 299
4 Correct 6 ms 640 KB Correct : C = 299
5 Correct 6 ms 640 KB Correct : C = 100
6 Correct 6 ms 640 KB Correct : C = 179
7 Correct 5 ms 512 KB Correct : C = 6
8 Incorrect 6 ms 636 KB Wrong
9 Correct 6 ms 600 KB Correct : C = 177
10 Correct 6 ms 640 KB Correct : C = 299
11 Correct 6 ms 600 KB Correct : C = 299
12 Correct 6 ms 640 KB Correct : C = 60
13 Correct 6 ms 512 KB Correct : C = 0
14 Correct 6 ms 640 KB Correct : C = 177
15 Incorrect 6 ms 640 KB Wrong
16 Correct 6 ms 512 KB Correct : C = 179
17 Correct 5 ms 640 KB Correct : C = 297
18 Correct 6 ms 640 KB Correct : C = 297
19 Correct 7 ms 640 KB Correct : C = 299
20 Correct 6 ms 640 KB Correct : C = 297
21 Correct 6 ms 560 KB Correct : C = 179
22 Correct 6 ms 512 KB Correct : C = 177
23 Correct 7 ms 640 KB Correct : C = 297
24 Correct 6 ms 560 KB Correct : C = 177
25 Correct 6 ms 640 KB Correct : C = 297
26 Correct 6 ms 640 KB Correct : C = 299
27 Incorrect 6 ms 512 KB Wrong