Submission #482672

#TimeUsernameProblemLanguageResultExecution timeMemory
482672rk42745417CONSUL (info1cup19_consul)C++17
0 / 100
1 ms424 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; #define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0); using ll = int64_t; using ull = uint64_t; using uint = uint32_t; using ld = long double; const int INF = 0x3f3f3f3f; const int MOD = 1e9 + 7; const ll LINF = ll(2e18) + ll(1e15); const double EPS = 1e-8; void solve(int n) { vector<int> arr(n); for(int i = 0; i < n; i++) arr[i] = i + 1; shuffle(arr.begin(), arr.end(), mt19937(time(0))); vector<bool> has(n + 1); int tmp = 0; for(int a : arr) { int x = kth(a); tmp++; if(tmp == 60) break; if(has[x]) continue; has[x] = true; int w = cnt(x); tmp++; if(w > n / 3) { say_answer(x); return; } if(tmp == 60) break; } say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...