답안 #315059

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
315059 2020-10-22T01:48:39 Z Seanliu CONSUL (info1cup19_consul) C++14
100 / 100
29 ms 256 KB
#include "grader.h"
#define min(a,b) ((a<b)?(a):(b))
int seed = 101;

inline int rnd(){
	return seed = (seed * 3 + 1) % 0xdefaced;
}


void solve(int N){
	for(int i = 0; i < min(30, (N / 2)); i++){
		int r = rnd() % N + 1;
		int v = kth(r);
		int c = cnt(v);
		//cout << "loc = " << r << ", val = " << v << ", cnt = " << c << endl;
		if(c > (N / 3)){
			say_answer(v);
			return;
		}
	}
	say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 256 KB Output is correct
2 Correct 7 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 256 KB Output is correct
2 Correct 24 ms 256 KB Output is correct
3 Correct 7 ms 256 KB Output is correct
4 Correct 7 ms 256 KB Output is correct
5 Correct 20 ms 256 KB Output is correct
6 Correct 24 ms 256 KB Output is correct
7 Correct 23 ms 256 KB Output is correct
8 Correct 18 ms 256 KB Output is correct
9 Correct 25 ms 256 KB Output is correct
10 Correct 29 ms 256 KB Output is correct
11 Correct 24 ms 256 KB Output is correct
12 Correct 22 ms 256 KB Output is correct
13 Correct 26 ms 256 KB Output is correct
14 Correct 25 ms 256 KB Output is correct