제출 #639294

#제출 시각아이디문제언어결과실행 시간메모리
639294LucaLucaMCONSUL (info1cup19_consul)C++17
컴파일 에러
0 ms0 KiB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

void solve(int n)
{
    int Q;
    
    if (n <= 50)
        Q = 50
    else
        Q = 60;

    for (int q = 0; q<Q; q+=2)
    {
        int i;
        i = rand();
        i %= n, i++;

        i = kth(i);
        if (cnt(i) > n/3)
        {
            say_answer(i);
            return;
        }
    }

    say_answer(-1);
}

컴파일 시 표준 에러 (stderr) 메시지

consul.cpp: In function 'void solve(int)':
consul.cpp:11:15: error: expected ';' before 'else'
   11 |         Q = 50
      |               ^
      |               ;
   12 |     else
      |     ~~~~