Submission #360854

# Submission time Handle Problem Language Result Execution time Memory
360854 2021-01-28T07:12:51 Z ezdp CONSUL (info1cup19_consul) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
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:6:6: error: 'll' was not declared in this scope
    6 |  set<ll> s;
      |      ^~
consul.cpp:6:8: error: template argument 1 is invalid
    6 |  set<ll> s;
      |        ^
consul.cpp:6:8: error: template argument 2 is invalid
consul.cpp:6:8: error: template argument 3 is invalid
consul.cpp:8:10: error: request for member 'size' in 's', which is of non-class type 'int'
    8 |  while(s.size() < 29){
      |          ^~~~
consul.cpp:10:9: error: request for member 'count' in 's', which is of non-class type 'int'
   10 |   if(!s.count(i)){
      |         ^~~~~
consul.cpp:11:6: error: request for member 'insert' in 's', which is of non-class type 'int'
   11 |    s.insert(i);
      |      ^~~~~~
consul.cpp:12:6: error: expected ';' before 'val'
   12 |    ll val = kth(i);
      |      ^~~~
      |      ;
consul.cpp:13:11: error: 'val' was not declared in this scope
   13 |    if(cnt(val) > n / 3){
      |           ^~~