Submission #238583

#TimeUsernameProblemLanguageResultExecution timeMemory
238583rahul_a_n콤보 (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; int guess_sequence(int N){ string ans; if(press("A")>0) ans="A"; else if(press("B")>0) ans="B"; else if(press("X")>0) ans="X"; else ans="Y"; for(int i=1;i<N;i++){ if(press(ans+"A")>i) ans+="A"; else if(press(ans+"B")>i) ans+="B"; else if(press(ans+"X")>i) ans+="X"; else ans+="Y"; } return ans; }

Compilation message (stderr)

combo.cpp:4:5: error: ambiguating new declaration of 'int guess_sequence(int)'
    4 | 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:24:10: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in return
   24 |   return ans;
      |          ^~~