제출 #364679

#제출 시각아이디문제언어결과실행 시간메모리
364679valerikkCONSUL (info1cup19_consul)C++17
컴파일 에러
0 ms0 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; int solve(int n) { mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count()); uniform_int_distribution<int> rd(1, n); int q = min(60, n); for (int qq = 0; qq < q / 2; qq++) { int i = rd(gen); int x = kth(i); if (3 * cnt(x) > n) return x; } return -1; }

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

consul.cpp:5:5: error: ambiguating new declaration of 'int solve(int)'
    5 | int solve(int n) {
      |     ^~~~~
In file included from consul.cpp:1:
grader.h:5:6: note: old declaration 'void solve(int)'
    5 | void solve(int n);
      |      ^~~~~