Submission #777138

#TimeUsernameProblemLanguageResultExecution timeMemory
777138LeaRouseCONSUL (info1cup19_consul)C++14
Compilation error
0 ms0 KiB
#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 (stderr)

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;
      |               ^~~~