# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149348 | 서울대학교 연구공원 944동 삼성전자서울대연구소 (#200) | Lokahian Relics (FXCUP4_lokahia) | C++17 | 7 ms | 688 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;
mt19937_64 rng(0x94949);
int R(int a, int b)
{
return uniform_int_distribution<int>(a, b)(rng);
}
int FindBase(int N){
if(N==1) return 0;
vector<int> cnt(N);
for(int i=0; i<600-N+1; ++i)
{
int v1, v2;
do
{
v1 = R(0, N-1);
v2 = R(0, N-1);
} while (v1==v2);
int x = CollectRelics(v1, v2);
if(x != -1) cnt[x] ++;
}
int maxi = max_element(cnt.begin(), cnt.end()) - cnt.begin();
int cc = 1;
for(int i=0; i<N; ++i)
if(i != maxi && -1 != CollectRelics(maxi, i))
++cc;
if(cc > N/2) return maxi;
else return -1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |