답안 #151059

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
151059 2019-09-01T16:14:51 Z Alexa2001 로카히아 유적 (FXCUP4_lokahia) C++17
0 / 100
3 ms 676 KB
#include "lokahia.h"
#include <bits/stdc++.h>

using namespace std;

int FindBase(int n)
{
    int i;
   // vector<int> good;

    int cnt = 0, who;

    for(i=0; i<n; ++i)
    {
        if(cnt == 0)
        {
          //  good.clear();
            who = i;
            cnt = 1;
        }
        else if(CollectRelics(who, i) != -1) ++cnt;// good.push_back(i);
            else --cnt;
    }

    if(!cnt) return -1;

    cnt = 0;
    int act = who;
    bool ok = 0;

    for(i=0; i<n; ++i)
        if(i == who) ++cnt;
            else
            {
                int res = CollectRelics(act, i);
                if(res == -1) continue;

                if(!ok) act = res, ok = 1;
                    else act = min(res, act);

                ++cnt;
            }
    if(cnt < (n+1)/2) return -1;
    return act;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 632 KB Wrong
2 Incorrect 3 ms 504 KB Wrong
3 Incorrect 3 ms 504 KB Wrong
4 Incorrect 3 ms 632 KB Wrong
5 Incorrect 3 ms 632 KB Wrong
6 Incorrect 2 ms 504 KB Wrong
7 Correct 2 ms 376 KB Correct : C = 0
8 Correct 2 ms 632 KB Correct : C = 177
9 Incorrect 3 ms 632 KB Wrong
10 Incorrect 2 ms 632 KB Wrong
11 Correct 2 ms 376 KB Correct : C = 8
12 Incorrect 2 ms 504 KB Wrong
13 Correct 2 ms 632 KB Correct : C = 100
14 Correct 3 ms 632 KB Correct : C = 191
15 Correct 2 ms 504 KB Correct : C = 60
16 Correct 2 ms 508 KB Correct : C = 297
17 Incorrect 3 ms 632 KB Wrong
18 Correct 3 ms 504 KB Correct : C = 111
19 Incorrect 2 ms 504 KB Wrong
20 Incorrect 3 ms 676 KB Wrong
21 Incorrect 2 ms 504 KB Wrong
22 Incorrect 2 ms 636 KB Wrong
23 Incorrect 3 ms 504 KB Wrong
24 Incorrect 3 ms 504 KB Wrong
25 Incorrect 2 ms 504 KB Wrong
26 Incorrect 2 ms 632 KB Wrong
27 Incorrect 2 ms 632 KB Wrong