#include "grader.h"
#include<unordered_map>
#include <stdlib.h>
#include<time.h>
#include<iostream>
using namespace std;
void solve(int n)
{
unordered_map<long long, int>mp;
srand (time(0));
for(int i=1;i<=min(n,60);i++)
{
long long pos=rand()%n+1;
long long val=kth(pos);
if(mp.count(val))continue;
mp[val]=1;
if(cnt(val) > n / 3){say_answer(val);return;}
}
say_answer(-1);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
12 ms |
200 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
22 ms |
200 KB |
Output is partially correct |
2 |
Correct |
6 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
22 ms |
200 KB |
Output is partially correct |
2 |
Partially correct |
34 ms |
200 KB |
Output is partially correct |
3 |
Correct |
7 ms |
200 KB |
Output is correct |
4 |
Correct |
7 ms |
200 KB |
Output is correct |
5 |
Partially correct |
27 ms |
200 KB |
Output is partially correct |
6 |
Partially correct |
31 ms |
200 KB |
Output is partially correct |
7 |
Partially correct |
33 ms |
200 KB |
Output is partially correct |
8 |
Partially correct |
35 ms |
200 KB |
Output is partially correct |
9 |
Partially correct |
32 ms |
200 KB |
Output is partially correct |
10 |
Partially correct |
33 ms |
200 KB |
Output is partially correct |
11 |
Partially correct |
35 ms |
200 KB |
Output is partially correct |
12 |
Partially correct |
29 ms |
200 KB |
Output is partially correct |
13 |
Partially correct |
26 ms |
200 KB |
Output is partially correct |
14 |
Partially correct |
31 ms |
200 KB |
Output is partially correct |