답안 #315055

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
315055 2020-10-22T01:45:23 Z Seanliu CONSUL (info1cup19_consul) C++14
85 / 100
28 ms 288 KB
#include "grader.h"
//#include <iostream>
//using namespace std;
int seed = 101;

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

void solve(int N){
	for(int i = 0; i < 30; 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 Incorrect 13 ms 256 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 256 KB Output is correct
2 Correct 8 ms 288 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 256 KB Output is correct
2 Correct 22 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 18 ms 256 KB Output is correct
6 Correct 23 ms 256 KB Output is correct
7 Correct 21 ms 256 KB Output is correct
8 Correct 26 ms 256 KB Output is correct
9 Correct 21 ms 256 KB Output is correct
10 Correct 21 ms 256 KB Output is correct
11 Correct 24 ms 256 KB Output is correct
12 Correct 21 ms 256 KB Output is correct
13 Correct 26 ms 256 KB Output is correct
14 Correct 28 ms 256 KB Output is correct