답안 #1100737

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1100737 2024-10-14T14:38:52 Z Kirill22 CONSUL (info1cup19_consul) C++17
컴파일 오류
0 ms 0 KB
#include "bits/stdc++.h"

using namespace std;

mt19937 gen(22);
int n;

void solve(int N) {
    n = N;
    int limit = n <= 50 ? 50 : 60;
    for (int i = 0; i < limit; i += 2) {
        int pos = gen() % n + 1;
        int x = kth(pos);
        if (cnt(x) > n / 3) {
            say_answer(x);
            return;
        }
    }
    say_answer(-1);
}

Compilation message

consul.cpp: In function 'void solve(int)':
consul.cpp:13:17: error: 'kth' was not declared in this scope
   13 |         int x = kth(pos);
      |                 ^~~
consul.cpp:14:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |         if (cnt(x) > n / 3) {
      |             ^~~
      |             int
consul.cpp:15:13: error: 'say_answer' was not declared in this scope
   15 |             say_answer(x);
      |             ^~~~~~~~~~
consul.cpp:19:5: error: 'say_answer' was not declared in this scope
   19 |     say_answer(-1);
      |     ^~~~~~~~~~