Submission #380848

#TimeUsernameProblemLanguageResultExecution timeMemory
380848fl0rianCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
using namespace std; std::string guess_sequence(int N) { string ans=""; string lets[4]={"A","B","X","Y"}; int dontUse=-1; int found=0; int i=0; for(int i=0;i<4&&dontUse==-1;i++) if(press(lets[i])) dontUse=i; ans+=lets[dontUse]; for(int i=1;i<N;i++){ found=0; for(int j=0;j<4 && !found;j++) if(dontUse!=j && press(ans + lets[j])==i+1 ){ ans+=lets[j]; found=1; } } //cout<<ans; return ans; }

Compilation message (stderr)

combo.cpp:4:6: error: 'string' in namespace 'std' does not name a type
    4 | std::string guess_sequence(int N) {
      |      ^~~~~~
combo.cpp:1:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
  +++ |+#include <string>
    1 |