| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 247165 | oolimry | Lokahian Relics (FXCUP4_lokahia) | C++17 | 6 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;
typedef pair<int,int> ii;
int FindBase(int N){
srand(time(NULL));
vector<int> v;
if(N == 1){
return 0;
}
for(int i = 0;i < N;i++) v.push_back(i);
int cnt = 0;
map<int,int> occur;
while(cnt < 400){
int a = rand() % N, b = rand() % N;
if(a == b) continue;
cnt++;
int x = CollectRelics(a,b);
occur[x]++;
}
int best = 0;
for(int i = 0;i < N;i++){
if(occur[best] < occur[i]){
best = i;
}
}
if(occur[best] >= 150) return best;
/*
int total = 0;
for(int i = 0;i < N;i++){
if(i == best){
total++;
continue;
}
if(CollectRelics(i,best) != -1) total++;
}
*/
//if(total > (N/2) ) return best;
return -1;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
