제출 #1234660

#제출 시각아이디문제언어결과실행 시간메모리
1234660durdonaCONSUL (info1cup19_consul)C++20
컴파일 에러
0 ms0 KiB
#include "grader.h" void solve(int n) { set<int> seen; for (int i = 0; i < min(n, 100); i++) { int val = kth(rand() % n + 1); if (seen.count(val)) continue; seen.insert(val); if (cnt(val) > n / 3) { say_answer(val); return; } } say_answer(-1); }

컴파일 시 표준 에러 (stderr) 메시지

consul.cpp: In function 'void solve(int)':
consul.cpp:5:5: error: 'set' was not declared in this scope
    5 |     set<int> seen;
      |     ^~~
consul.cpp:5:9: error: expected primary-expression before 'int'
    5 |     set<int> seen;
      |         ^~~
consul.cpp:6:25: error: 'min' was not declared in this scope
    6 |     for (int i = 0; i < min(n, 100); i++) {
      |                         ^~~
consul.cpp:7:23: error: 'rand' was not declared in this scope
    7 |         int val = kth(rand() % n + 1);
      |                       ^~~~
consul.cpp:8:13: error: 'seen' was not declared in this scope
    8 |         if (seen.count(val)) continue;
      |             ^~~~
consul.cpp:9:9: error: 'seen' was not declared in this scope
    9 |         seen.insert(val);
      |         ^~~~