This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int n)
{
int v,vis[1001]={0},sum=0;
for(int i=1; i<=n; i++)
{
v=kth(i);
if(vis[v]) continue;
vis[v]=cnt(v); sum+=vis[v];
if(abs((n-sum)/(n-i)-n/3) >=1e-6) break;
if(vis[v]>n/3)
{
say_answer(v); return;
}
}
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... |