Submission #149348

#TimeUsernameProblemLanguageResultExecution timeMemory
149348서울대학교 연구공원 944동 삼성전자서울대연구소 (#200)Lokahian Relics (FXCUP4_lokahia)C++17
0 / 100
7 ms688 KiB
#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 timeMemoryGrader output
Fetching results...