Submission #693106

# Submission time Handle Problem Language Result Execution time Memory
693106 2023-02-02T11:39:33 Z auslander CONSUL (info1cup19_consul) C++17
0 / 100
35 ms 304 KB
#include "grader.h"
#include <map>
using namespace std;

map<int, int>mp;

void solve(int n)
{
	int i;
	int k = 60;
	if (n <= 50)
		k = 50;
	for (i = 1; i <= n; i++)
	{
		int k = kth(i);
		if (mp[k] == 0)
			mp[k] = cnt(k);
		if (mp[k] > n / 3)
		{
			say_answer(k);
			return;
		}
	}
	say_answer(-1);
}

Compilation message

consul.cpp: In function 'void solve(int)':
consul.cpp:10:6: warning: variable 'k' set but not used [-Wunused-but-set-variable]
   10 |  int k = 60;
      |      ^
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 208 KB Too many queries
2 Halted 0 ms 0 KB -