# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149786 | CHT를 사랑하는 모임 (#200) | Lokahian Relics (FXCUP4_lokahia) | C++17 | 8 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<vector>
#include<ctime>
#include<algorithm>
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const ll inf=1e18;
int C[205];
int FindBase(int N)
{
if(N==1)
return 0;
for(int i=0;i<500;i++)
srand(time(0));
for(int i=0;i<601-N;i++)
{
int n=rand()%N;
int j=n;
while(j==n)
j=rand()%N;
int t=CollectRelics(n,j);
if(t!=-1)
C[t]++;
}
int m,M=-1;
for(int i=0;i<N;i++)
if(C[i]>M)
m=i,M=C[i];
int c=0;
for(int i=0;i<N;i++)
{
if(i==m)
c++;
else
c+=CollectRelics(i,m)!=-1;
}
if(c<N/2)
return-1;
return m;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |