# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
364127 | soba | CONSUL (info1cup19_consul) | C++14 | 37 ms | 512 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 <bits/stdc++.h>
#include "grader.h"
//#include "grader.cpp"
using namespace std;
void solve(int n)
{
int need=(n)/3;
need++;
vector<int>v;
for(int i=1; i <= n ; i++)
{
v.push_back(i);
}
random_shuffle(v.begin(), v.end());
random_shuffle(v.begin(), v.end());
random_shuffle(v.begin(), v.end());
int cn=1 , ans=-1;
map<int,int>mp;
for(int i = 1 ; i<=min(30,need) ; i++)
{
int x=kth(v[i]);
if(mp[x])
continue;
else mp[x]=cnt(x);
if(mp[x]>=need)
{
ans=x;
break;
}
}
say_answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |