제출 #360853

#제출 시각아이디문제언어결과실행 시간메모리
360853ezdpCONSUL (info1cup19_consul)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h"

void solve(int n)
{
	set<ll> s;
	srand(69696969);
	while(s.size() < 29){
		int i = rand() % n + 1;
		if(!s.count(i)){
			s.insert(i);
			ll val = kth(i);
			if(cnt(val) > n / 3){
				say_answer(val);
				return;
			}
		}
	}
    say_answer(cnt(kth(1)) > n / 3 ? kth(1) : -1);
}

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

consul.cpp: In function 'void solve(int)':
consul.cpp:5:2: error: 'set' was not declared in this scope
    5 |  set<ll> s;
      |  ^~~
consul.cpp:5:6: error: 'll' was not declared in this scope
    5 |  set<ll> s;
      |      ^~
consul.cpp:5:10: error: 's' was not declared in this scope
    5 |  set<ll> s;
      |          ^
consul.cpp:6:2: error: 'srand' was not declared in this scope
    6 |  srand(69696969);
      |  ^~~~~
consul.cpp:8:11: error: 'rand' was not declared in this scope
    8 |   int i = rand() % n + 1;
      |           ^~~~
consul.cpp:11:6: error: expected ';' before 'val'
   11 |    ll val = kth(i);
      |      ^~~~
      |      ;
consul.cpp:12:11: error: 'val' was not declared in this scope
   12 |    if(cnt(val) > n / 3){
      |           ^~~