답안 #363343

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
363343 2021-02-05T15:34:32 Z mosiashvililuka CONSUL (info1cup19_consul) C++14
100 / 100
33 ms 384 KB
#include <bits/stdc++.h>
#include "grader.h"

using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,Q,t,tes,f[200009],bo[200009];
/*int kth(int k);
void say_answer(int k);
int cnt(int k);*/
int nicerand(int q){
	int w=0,we=1;
	while(q>0){
		q--;
		if(rand()%2!=0) w+=we;
		we*=2;
	}
	return w;
}
void solve(int n)
{
    /// insert your code
    /// for example
    /*if(cnt(kth(1)) > n / 3) say_answer(kth(1));
        else say_answer(-1);*/
    a=n;
    if(n<=50) Q=50; else Q=60;
    e=0;
    while(e<=Q){
    	c=nicerand(20)%a+1;
    	e+=2;
    	zx=kth(c);
    	xc=cnt(zx);
    	if(xc>a/3){
    		say_answer(zx);
    		break;
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 364 KB Output is correct
2 Correct 9 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 364 KB Output is correct
2 Correct 23 ms 364 KB Output is correct
3 Correct 7 ms 364 KB Output is correct
4 Correct 9 ms 364 KB Output is correct
5 Correct 21 ms 364 KB Output is correct
6 Correct 32 ms 364 KB Output is correct
7 Correct 23 ms 364 KB Output is correct
8 Correct 31 ms 384 KB Output is correct
9 Correct 32 ms 364 KB Output is correct
10 Correct 24 ms 364 KB Output is correct
11 Correct 33 ms 364 KB Output is correct
12 Correct 26 ms 364 KB Output is correct
13 Correct 22 ms 364 KB Output is correct
14 Correct 28 ms 364 KB Output is correct