#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int n)
{
int v;
map<int,int> can;
for(int i=1; i<=n; i++)
{
v=kth(i);
can[v]++;
if(can[v]>n/3)
{
say_answer(v); return;
}
}
say_answer(-1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
64 ms |
256 KB |
Output is partially correct |
2 |
Partially correct |
75 ms |
256 KB |
Output is partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
821 ms |
384 KB |
Output is partially correct |
2 |
Halted |
0 ms |
0 KB |
- |