# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
799851 | n3rm1n | CONSUL (info1cup19_consul) | C++17 | 1 ms | 208 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"
#define endl '\n'
using namespace std;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
void solve(int N)
{
map < int, int > checked;
int atleast = N/3 + 1;
vector < int > index;
for (int i = 1; i <= N; ++ i)
index.push_back(i);
random_shuffle(index.begin(), index.end());
vector < int > g;
for (int i = 0; i < min(N, 30); ++ i)
{
cout << index[i] << endl;
int x = kth(index[i]);
if(checked[x])continue;
else
{ g.push_back(x);
}
checked[x] = 1;
}
for (int i = 0; i < g.size(); ++ i)
{
if(cnt(g[i]) >= atleast)
{
say_answer(g[i]);
return;
}
}
say_answer(-1);
}
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... |