답안 #523153

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
523153 2022-02-07T06:49:51 Z reni CONSUL (info1cup19_consul) C++14
85 / 100
36 ms 200 KB
#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));
    int br=0;
    for(int i=1;i<=60;i++)
    {
        if(br>58)break;
        long long pos=rand()%n+1;
        long long val=kth(pos);br++;

        if(mp.count(val))continue;
        mp[val]=1;
            br++;
         if(cnt(val) > n / 3){say_answer(val);return;}
    }
        say_answer(-1);return;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 200 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 200 KB Output is correct
2 Correct 7 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 200 KB Output is correct
2 Correct 27 ms 200 KB Output is correct
3 Correct 8 ms 200 KB Output is correct
4 Correct 7 ms 200 KB Output is correct
5 Correct 9 ms 200 KB Output is correct
6 Correct 24 ms 200 KB Output is correct
7 Correct 27 ms 200 KB Output is correct
8 Correct 29 ms 200 KB Output is correct
9 Correct 25 ms 200 KB Output is correct
10 Correct 28 ms 200 KB Output is correct
11 Correct 36 ms 200 KB Output is correct
12 Correct 23 ms 200 KB Output is correct
13 Correct 25 ms 200 KB Output is correct
14 Correct 21 ms 200 KB Output is correct