Submission #232262

#TimeUsernameProblemLanguageResultExecution timeMemory
232262pere_gilCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include "combo.h" using namespace std; int guess_sequence(int N) { string s=""; for(int i=0;i<N;i++){ if(press(s+"A")>0){ s+="A"; } else{ if(press(s+"B")>0){ s+="B"; } else{ if(press(s+"X")>0){ s+="X"; } else{ s+="Y"; } } } } return s; }

Compilation message (stderr)

combo.cpp:6:5: error: ambiguating new declaration of 'int guess_sequence(int)'
    6 | int guess_sequence(int N)
      |     ^~~~~~~~~~~~~~
In file included from combo.cpp:2:
combo.h:5:13: note: old declaration 'std::string guess_sequence(int)'
    5 | std::string guess_sequence(int N);
      |             ^~~~~~~~~~~~~~
combo.cpp: In function 'int guess_sequence(int)':
combo.cpp:27:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in return
   27 |     return s;
      |            ^