답안 #150779

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150779 2019-09-01T08:55:37 Z rkm0959(#3623, jun6873, babo) 로카히아 유적 (FXCUP4_lokahia) C++17
0 / 100
9 ms 640 KB
#include "lokahia.h"
#include <bits/stdc++.h>
using namespace std;

int FindBase(int N) {
    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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 640 KB Correct : C = 297
2 Correct 6 ms 640 KB Correct : C = 297
3 Correct 6 ms 512 KB Correct : C = 179
4 Correct 6 ms 640 KB Correct : C = 177
5 Correct 6 ms 640 KB Correct : C = 299
6 Correct 7 ms 640 KB Correct : C = 297
7 Correct 6 ms 636 KB Correct : C = 297
8 Correct 6 ms 512 KB Correct : C = 297
9 Incorrect 7 ms 640 KB Wrong
10 Correct 6 ms 640 KB Correct : C = 100
11 Correct 6 ms 640 KB Correct : C = 297
12 Correct 6 ms 640 KB Correct : C = 179
13 Correct 8 ms 640 KB Correct : C = 179
14 Correct 6 ms 512 KB Correct : C = 177
15 Correct 6 ms 640 KB Correct : C = 299
16 Correct 6 ms 512 KB Correct : C = 177
17 Correct 6 ms 640 KB Correct : C = 179
18 Correct 6 ms 512 KB Correct : C = 177
19 Correct 9 ms 640 KB Correct : C = 299
20 Correct 8 ms 512 KB Correct : C = 177
21 Correct 5 ms 512 KB Correct : C = 6
22 Correct 9 ms 640 KB Correct : C = 299
23 Correct 6 ms 640 KB Correct : C = 299
24 Correct 6 ms 640 KB Correct : C = 299
25 Correct 6 ms 512 KB Correct : C = 60
26 Correct 6 ms 512 KB Correct : C = 0
27 Incorrect 6 ms 640 KB Wrong