답안 #229286

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
229286 2020-05-04T05:37:57 Z 534351 로카히아 유적 (FXCUP4_lokahia) C++17
0 / 100
6 ms 640 KB
#include "lokahia.h"
#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
    if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
    if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int FindBase(int N)
{
    int maj = -1, cnt = 0;
    FOR(i, 0, N - 1)
    {
        if (cnt == 0)
        {
            maj = i;
            cnt++;
        }
        else
        {
            int w = CollectRelics(maj, i);
            if (w == -1)
            {
                cnt--;
            }
            else
            {
                maj = i;
                cnt++;
            }
        }
    }
    if (cnt == 0) maj = N - 1;
    cnt = 1;
    int res = -1;
    FOR(i, 0, N)
    {
        if (i == maj) continue;
        int w = CollectRelics(maj, i);
        if (w != -1)
        {
            cnt++;
            ckmax(res, w);
        }
    }
    return ((cnt > N / 2) ? res : -1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 512 KB Correct : C = 235
2 Partially correct 5 ms 640 KB Partially correct : C = 389
3 Correct 5 ms 512 KB Correct : C = 237
4 Partially correct 5 ms 640 KB Partially correct : C = 384
5 Correct 5 ms 512 KB Correct : C = 235
6 Correct 5 ms 512 KB Correct : C = 234
7 Partially correct 6 ms 560 KB Partially correct : C = 397
8 Correct 5 ms 512 KB Correct : C = 223
9 Partially correct 5 ms 640 KB Partially correct : C = 383
10 Incorrect 4 ms 384 KB Wrong
11 Correct 5 ms 640 KB Correct : C = 297
12 Partially correct 5 ms 640 KB Partially correct : C = 395
13 Partially correct 5 ms 640 KB Partially correct : C = 384
14 Correct 5 ms 512 KB Correct : C = 178
15 Partially correct 5 ms 640 KB Partially correct : C = 309
16 Partially correct 5 ms 640 KB Partially correct : C = 380
17 Correct 5 ms 640 KB Correct : C = 298
18 Correct 4 ms 512 KB Correct : C = 7
19 Correct 5 ms 512 KB Correct : C = 177
20 Partially correct 5 ms 640 KB Partially correct : C = 384
21 Correct 5 ms 512 KB Correct : C = 228
22 Partially correct 5 ms 640 KB Partially correct : C = 397
23 Partially correct 6 ms 640 KB Partially correct : C = 395
24 Partially correct 5 ms 640 KB Partially correct : C = 388
25 Partially correct 5 ms 640 KB Partially correct : C = 317
26 Correct 5 ms 640 KB Correct : C = 224
27 Correct 5 ms 512 KB Correct : C = 228