# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
248228 | lyc | Lokahian Relics (FXCUP4_lokahia) | C++17 | 2 ms | 640 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "lokahia.h"
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)
int FindBase(int N){
int x = 0, y = 1, z;
FOR(i,1,N-1){
if (y == 0) x = i, y = 1;
else if (x == i || (z = CollectRelics(x,i)) != -1) x = z, ++y;
else --y;
}
int c = 1;
FOR(i,0,N-1) if (x != i) {
if (CollectRelics(x,i) != -1) ++c;
}
return (c > N/2 ? x : -1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |