Submission #777138

# Submission time Handle Problem Language Result Execution time Memory
777138 2023-07-08T17:42:40 Z LeaRouse CONSUL (info1cup19_consul) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include <grader.h>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define ll long long
using namespace std;
map<int,int>m;
int say_answer(int n){
    for(int i=0;i<n;i++){
        m[kth(i+1)]++;
    }
    for(auto it:m){
        if(it.second>n/3){
            cout<<it.first<<endl;
            return;
        }
    }
    cout<<-1<<endl;
}

Compilation message

consul.cpp:7:5: error: ambiguating new declaration of 'int say_answer(int)'
    7 | int say_answer(int n){
      |     ^~~~~~~~~~
In file included from consul.cpp:2:
grader.h:7:6: note: old declaration 'void say_answer(int)'
    7 | void say_answer(int k);
      |      ^~~~~~~~~~
consul.cpp: In function 'int say_answer(int)':
consul.cpp:14:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   14 |             return;
      |             ^~~~~~
consul.cpp:17:15: warning: control reaches end of non-void function [-Wreturn-type]
   17 |     cout<<-1<<endl;
      |               ^~~~