답안 #474384

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
474384 2021-09-18T06:51:21 Z hhhhaura CONSUL (info1cup19_consul) C++14
85 / 100
38 ms 200 KB
#include "grader.h"
#define wiwihorz
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma loop-opt(on)

#define rep(i, a, b) for(int i = a; i <= b; i ++)
#define rrep(i, a, b) for(int i = b; i >= a; i--)
#define all(x) x.begin(), x.end()
#define ceil(a, b) ((a + b - 1) / (b))

using namespace std;

#define lld long double
#define pii pair<int, int>
#define random mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count())

#ifdef wiwihorz
#define print(a...) cerr << "Line: " << __LINE__, kout("[" + string(#a) + "] = ", a)
void vprint(auto L, auto R) { cerr << *L << " \n"[next(L) == R], ++L; }
void kout() { cerr << endl; }
template<class T1, class ... T2> void kout(T1 a, T2 ... e) { cerr << a << " ", kout(e...);}
#else
#define print(...) 0
#define vprint(...) 0
#endif
random;
void solve(int n)
{
    set<int> s;
    rep(i, 1, 30) {
    	int k;
    	while(k = rnd() % n + 1, s.find(k) != s.end());
    	s.insert(k);
    	k = kth(k);
    	if(cnt(k) > n / 3) {
    		say_answer(k);
    		return;
    	}
    }
    say_answer(-1);
}

Compilation message

consul.cpp:5: warning: ignoring '#pragma loop ' [-Wunknown-pragmas]
    5 | #pragma loop-opt(on)
      | 
consul.cpp:20:13: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   20 | void vprint(auto L, auto R) { cerr << *L << " \n"[next(L) == R], ++L; }
      |             ^~~~
consul.cpp:20:21: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   20 | void vprint(auto L, auto R) { cerr << *L << " \n"[next(L) == R], ++L; }
      |                     ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 200 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 200 KB Output is correct
2 Correct 7 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 200 KB Output is correct
2 Correct 31 ms 200 KB Output is correct
3 Correct 9 ms 200 KB Output is correct
4 Correct 7 ms 200 KB Output is correct
5 Correct 24 ms 200 KB Output is correct
6 Correct 17 ms 200 KB Output is correct
7 Correct 31 ms 200 KB Output is correct
8 Correct 30 ms 200 KB Output is correct
9 Correct 27 ms 200 KB Output is correct
10 Correct 16 ms 200 KB Output is correct
11 Correct 38 ms 200 KB Output is correct
12 Correct 27 ms 200 KB Output is correct
13 Correct 30 ms 200 KB Output is correct
14 Correct 32 ms 200 KB Output is correct