답안 #331993

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
331993 2020-12-01T02:13:54 Z jjj CONSUL (info1cup19_consul) C++14
100 / 100
69 ms 364 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;

void solve(int n)
{
   int k;

   if(n > 50) k = 30;
   else k = 25;

   int m = 0, a = -1;

   mt19937 mt_rand(time(0));

   while(k--)
   {
       int i = uniform_int_distribution <int> (1, n)(mt_rand);

       int e = kth(i), c = cnt(e);

       if(c > m)
       {
           m = c;
           a = e;
       }
   }

    if(m > n / 3) say_answer(a);
    else say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 40 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 364 KB Output is correct
2 Correct 32 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 364 KB Output is correct
2 Correct 65 ms 364 KB Output is correct
3 Correct 59 ms 364 KB Output is correct
4 Correct 58 ms 364 KB Output is correct
5 Correct 47 ms 364 KB Output is correct
6 Correct 50 ms 364 KB Output is correct
7 Correct 34 ms 364 KB Output is correct
8 Correct 66 ms 364 KB Output is correct
9 Correct 60 ms 364 KB Output is correct
10 Correct 55 ms 364 KB Output is correct
11 Correct 69 ms 364 KB Output is correct
12 Correct 55 ms 364 KB Output is correct
13 Correct 57 ms 364 KB Output is correct
14 Correct 40 ms 364 KB Output is correct