답안 #364297

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
364297 2021-02-08T20:44:33 Z Alexandruabcde CONSUL (info1cup19_consul) C++14
19.9608 / 100
47 ms 384 KB
#include "grader.h"

void solve(int n)
{
    if (n <= 40) {
        for (int i = 1; i <= n; ++ i ) {
            int x = kth(i);

            if (cnt(x) > n/3) {
                say_answer(x);
                return;
            }
        }
    }
    else if (n <= 100) {
        for (int i = 1; i <= n; i += 2) {
            int x = kth(i);

            if (cnt(x) > n/3) {
                say_answer(x);
                return;
            }
        }
    }
    else {
        for (int i = 1; i <= n; i += 20) {
            int x = kth(i);

            if (cnt(x) > n/3) {
                say_answer(x);
                return;
            }
        }
    }
    say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 28 ms 256 KB Output is partially correct
2 Partially correct 24 ms 256 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 33 ms 256 KB Output is partially correct
2 Partially correct 41 ms 256 KB Output is partially correct
3 Partially correct 24 ms 256 KB Output is partially correct
4 Partially correct 18 ms 256 KB Output is partially correct
5 Partially correct 31 ms 256 KB Output is partially correct
6 Partially correct 42 ms 256 KB Output is partially correct
7 Partially correct 30 ms 256 KB Output is partially correct
8 Partially correct 36 ms 256 KB Output is partially correct
9 Partially correct 39 ms 256 KB Output is partially correct
10 Partially correct 40 ms 256 KB Output is partially correct
11 Partially correct 47 ms 256 KB Output is partially correct
12 Partially correct 16 ms 384 KB Output is partially correct
13 Partially correct 47 ms 256 KB Output is partially correct
14 Partially correct 36 ms 256 KB Output is partially correct