제출 #1313281

#제출 시각아이디문제언어결과실행 시간메모리
1313281neonglitchCONSUL (info1cup19_consul)C++20
85 / 100
8 ms400 KiB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int n)
{
    /// insert your code
    /// for example
	int a[n+2]={0};
	for(int i=1;i<=n;i++)a[i]=-1;
	int lm=n/3;
	srand(time(0));
	for(int ip=0;ip<30;ip++)
	{
		int j=rand()%n + 1;
		while(a[j]!=-1)
		{
			j=rand()%n+1;
		}
		a[j]=kth(j);
		if(cnt(a[j])>lm)
		{
			say_answer(a[j]);
			return;
		}
	}
	say_answer(-1);
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…