제출 #1147008

#제출 시각아이디문제언어결과실행 시간메모리
1147008Ice_manCONSUL (info1cup19_consul)C++20
컴파일 에러
0 ms0 KiB
/**
 ____    ____    ____    __________________    ____    ____    ____
||I ||  ||c ||  ||e ||  ||                ||  ||M ||  ||a ||  ||n ||
||__||  ||__||  ||__||  ||________________||  ||__||  ||__||  ||__||
|/__\|  |/__\|  |/__\|  |/________________\|  |/__\|  |/__\|  |/__\|

*/

#include <iostream>
#include <chrono>
#include <vector>
#include "grader.h"

#define maxn 305
#define maxlog 20
#define INF 1000000010
#define LINF 1000000000000000005
#define endl '\n'
#define pb(x) push_back(x)
#define X first
#define Y second
#define mod 998244353
#define control cout<<"passed"<<endl;

using namespace std;


typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;
typedef pair <ll, ll> pll;
typedef pair <int, ll> pil;
typedef pair <ll, int> pli;
typedef long double pd;



void solve(int n)
{
    random_device rd;
    mt19937 rng(rd());
    uniform_int_distribution <int> d(1 , n);
    
    for(int step = 1; step <= 30; step++)
    {
        int i = d(rng());
        int candidate = kth(i);
        int br = cnt(candidate);
        
        if(br > n / 3)
        {
            bool c = say_answer(candidate);
            if(c == true)
                return;
        }
    }
}

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

consul.cpp: In function 'void solve(int)':
consul.cpp:40:5: error: 'random_device' was not declared in this scope; did you mean 'random_data'?
   40 |     random_device rd;
      |     ^~~~~~~~~~~~~
      |     random_data
consul.cpp:41:5: error: 'mt19937' was not declared in this scope
   41 |     mt19937 rng(rd());
      |     ^~~~~~~
consul.cpp:46:19: error: 'rng' was not declared in this scope
   46 |         int i = d(rng());
      |                   ^~~
consul.cpp:52:32: error: void value not ignored as it ought to be
   52 |             bool c = say_answer(candidate);
      |                      ~~~~~~~~~~^~~~~~~~~~~