| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1155069 | sash01 | CONSUL (info1cup19_consul) | C++20 | 4 ms | 420 KiB |
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int n)
{
random_device rd;
mt19937 gen(rd());
int br=0,l=0,r;
map <int,int> used,m;
while(1)
{
if(br>(double)n/3*2)break;
if(br==n)break;
uniform_int_distribution<> d(1, n);
int ans=d(gen);
if(m[ans])continue;
else m[ans]=1;
ans=kth(ans);
r=cnt(ans);
if(used[ans])continue;
else
{
used[ans]=1;
br+=r;
}
if(r>(double)n/3)
{
say_answer(ans);
l=1;
break;
}
}
if(l==0)
say_answer(-1);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
