Submission #365225

# Submission time Handle Problem Language Result Execution time Memory
365225 2021-02-11T09:33:25 Z tengiz05 CONSUL (info1cup19_consul) C++17
0 / 100
11 ms 364 KB
#include "grader.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
void solve(int n){
	vector<int> inds;
	for(int i=1;i<=n;i++)inds.push_back(i);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	shuffle(inds.begin(), inds.end(), rng);
	int numq = min(n,n);
	for(int i=0;i<numq;i++){
		int x = kth(inds[i]);
		int c = cnt(inds[i]);
		if(c > n/3){
			say_answer(x);
			return;
		}
	}
	say_answer(-1);
	return;
}


/*

2
9
4 2 3 4 1 2 5 4

9
4 2 3 4 4 2 5 4



*/
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 364 KB Too many queries
2 Halted 0 ms 0 KB -