답안 #330406

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
330406 2020-11-25T06:35:56 Z kshitij_sodani CONSUL (info1cup19_consul) C++14
100 / 100
49 ms 416 KB
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second
#define endl '\n'


#include "grader.h"

void solve(int n){
	mt19937 rng;
	rng=mt19937(chrono::steady_clock::now().time_since_epoch().count());

    set<int> ss;
    for(int i=0;i<n;i++){
    	ss.insert(i+1);
    }

    for(int i=0;i<25;i++){
    	vector<int> tt;
    	for(auto j:ss){
    		tt.pb(j);

    	}
    	if(tt.size()==0){
    		break;
    	}
    	int xx=rng()%(tt.size());
    	int x=kth(tt[xx]);
    	if(cnt(x)>n/3){
    		 say_answer(x);
    		 return;
    	}
    	ss.erase(tt[xx]);
    }
    say_answer(-1);









}
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 364 KB Output is correct
2 Correct 8 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 364 KB Output is correct
2 Correct 42 ms 364 KB Output is correct
3 Correct 17 ms 364 KB Output is correct
4 Correct 20 ms 364 KB Output is correct
5 Correct 37 ms 364 KB Output is correct
6 Correct 33 ms 364 KB Output is correct
7 Correct 41 ms 364 KB Output is correct
8 Correct 49 ms 364 KB Output is correct
9 Correct 36 ms 364 KB Output is correct
10 Correct 42 ms 416 KB Output is correct
11 Correct 44 ms 364 KB Output is correct
12 Correct 33 ms 364 KB Output is correct
13 Correct 43 ms 364 KB Output is correct
14 Correct 41 ms 364 KB Output is correct