답안 #427405

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
427405 2021-06-14T14:57:32 Z MilosMilutinovic CONSUL (info1cup19_consul) C++14
컴파일 오류
0 ms 0 KB
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;

mt19937 rng(time(0));

void solve(int N) {
    for (int rep = 1; rep <= 25; rep++) {
        int pos = rng() % N + 1;

        int element = kth(pos);

        if (cnt(element) > n / 3) return element;
    }
    say_answer(-1);
}

Compilation message

consul.cpp: In function 'void solve(int)':
consul.cpp:13:28: error: 'n' was not declared in this scope
   13 |         if (cnt(element) > n / 3) return element;
      |                            ^
consul.cpp:13:42: error: return-statement with a value, in function returning 'void' [-fpermissive]
   13 |         if (cnt(element) > n / 3) return element;
      |                                          ^~~~~~~