답안 #360853

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
360853 2021-01-28T07:12:24 Z ezdp CONSUL (info1cup19_consul) C++14
컴파일 오류
0 ms 0 KB
#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);
}

Compilation message

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){
      |           ^~~