제출 #777201

#제출 시각아이디문제언어결과실행 시간메모리
777201LeaRouseCONSUL (info1cup19_consul)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h"
#include    <map>
#define ll long long
using namespace std;
void solve(int n){
    for(int i=1;i<25;i++){
        int nc=kth(rand()%n +1);
        int awa=cnt(nc);
        if(awa>n/3){
            say_answer(awa);
            return;
        }
    }
    say_answer(-1); 
}

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

consul.cpp: In function 'void solve(int)':
consul.cpp:7:20: error: 'rand' was not declared in this scope
    7 |         int nc=kth(rand()%n +1);
      |                    ^~~~