Submission #1147009

#TimeUsernameProblemLanguageResultExecution timeMemory
1147009Ice_manCONSUL (info1cup19_consul)C++20
Compilation error
0 ms0 KiB
/**
 ____    ____    ____    __________________    ____    ____    ____
||I ||  ||c ||  ||e ||  ||                ||  ||M ||  ||a ||  ||n ||
||__||  ||__||  ||__||  ||________________||  ||__||  ||__||  ||__||
|/__\|  |/__\|  |/__\|  |/________________\|  |/__\|  |/__\|  |/__\|

*/

#include <iostream>
#include <chrono>
#include <vector>
#include <random>
#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;
        }
    }
}

Compilation message (stderr)

consul.cpp: In function 'void solve(int)':
consul.cpp:53:32: error: void value not ignored as it ought to be
   53 |             bool c = say_answer(candidate);
      |                      ~~~~~~~~~~^~~~~~~~~~~