Submission #639074

# Submission time Handle Problem Language Result Execution time Memory
639074 2022-09-08T13:24:03 Z alexx_stefan CONSUL (info1cup19_consul) C++17
Compilation error
0 ms 0 KB
#include "grader.h"
#include<bits/stdc++.h>
void solve(int n)
{
    /// insert your code
    /// for example
    for (int i=1;i<=min(n,25);i++)
    {
        int x=kth(i);
        if (cnt(x)>n/3)
    {
        say_answer(x);
        return ;
    }
    }
    say_answer(-1);
}

Compilation message

consul.cpp: In function 'void solve(int)':
consul.cpp:7:21: error: 'min' was not declared in this scope; did you mean 'std::min'?
    7 |     for (int i=1;i<=min(n,25);i++)
      |                     ^~~
      |                     std::min
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from consul.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~