답안 #861251

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
861251 2023-10-15T17:42:29 Z Ahmed57 CONSUL (info1cup19_consul) C++17
100 / 100
10 ms 596 KB
#include <bits/stdc++.h>

using namespace std;
int kth(int i);
int cnt(int x);
void say_answer(int a);
void solve(int N){
    srand(244);
    for(int i = 1;i<=min(N/2,30);i++){
        int w = kth(rand()%N+1);
        int x = cnt(w);
        if(x>N/3){
            say_answer(w);
            return ;
        }
    }
    say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 344 KB Output is correct
2 Correct 9 ms 344 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 8 ms 344 KB Output is correct
6 Correct 10 ms 344 KB Output is correct
7 Correct 9 ms 344 KB Output is correct
8 Correct 10 ms 344 KB Output is correct
9 Correct 9 ms 344 KB Output is correct
10 Correct 10 ms 344 KB Output is correct
11 Correct 9 ms 344 KB Output is correct
12 Correct 9 ms 596 KB Output is correct
13 Correct 10 ms 344 KB Output is correct
14 Correct 8 ms 344 KB Output is correct