Submission #1234653

#TimeUsernameProblemLanguageResultExecution timeMemory
1234653khomeCONSUL (info1cup19_consul)C++20
100 / 100
1 ms408 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; set<int> st; int get_new(int n){ srand((int)time(0)); int i = rand()%n+1; while (st.find(i) != st.end()) i = rand()%n+1; st.insert(i); return i; } void solve(int n) { map<int, int> mp; int all = 0; // cout << "YES" << endl; return; while (true) { int k = kth(get_new(n)); int k_cnt = cnt(k); if (mp[k] != k_cnt) all += k_cnt; mp[k] = k_cnt; if (mp[k] > n/3) { say_answer(k); return; } // cout << all << endl; if (st.size() >= n) { say_answer(-1); return; } } say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...