Submission #151055

# Submission time Handle Problem Language Result Execution time Memory
151055 2019-09-01T16:09:49 Z Alexa2001 Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
3 ms 632 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 ans = n;

    for(i=0; i<n; ++i)
        if(i == who) ++cnt;
            else
            {
                int act = CollectRelics(who, i);
                if(act == -1) continue;
                ans = min(ans, act);
                ++cnt;
            }
    if(cnt < n/2) return -1;
    return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 3 ms 632 KB Partially correct : C = 398
2 Correct 3 ms 504 KB Correct : C = 191
3 Partially correct 3 ms 632 KB Partially correct : C = 385
4 Correct 2 ms 504 KB Correct : C = 225
5 Partially correct 3 ms 504 KB Partially correct : C = 317
6 Partially correct 3 ms 504 KB Partially correct : C = 398
7 Partially correct 3 ms 504 KB Partially correct : C = 396
8 Correct 2 ms 504 KB Correct : C = 100
9 Incorrect 2 ms 504 KB Wrong
10 Correct 2 ms 504 KB Correct : C = 297
11 Correct 2 ms 504 KB Correct : C = 224
12 Correct 2 ms 548 KB Correct : C = 228
13 Correct 2 ms 632 KB Correct : C = 177
14 Incorrect 2 ms 632 KB Wrong
15 Partially correct 3 ms 548 KB Partially correct : C = 385
16 Correct 2 ms 444 KB Correct : C = 8
17 Partially correct 3 ms 632 KB Partially correct : C = 380
18 Correct 2 ms 504 KB Correct : C = 60
19 Partially correct 3 ms 632 KB Partially correct : C = 396
20 Incorrect 3 ms 504 KB Wrong
21 Partially correct 3 ms 632 KB Partially correct : C = 385
22 Correct 2 ms 504 KB Correct : C = 229
23 Correct 3 ms 504 KB Correct : C = 111
24 Correct 2 ms 556 KB Correct : C = 238
25 Partially correct 3 ms 504 KB Partially correct : C = 389
26 Correct 2 ms 632 KB Correct : C = 236
27 Correct 2 ms 632 KB Correct : C = 236