Submission #92966

#TimeUsernameProblemLanguageResultExecution timeMemory
92966beso123Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" string a="ABXY"; using namespace std; string guess_sequence(int N){ string s; for(int k=1;k<=n;k++) if(press(a[k])==1){ s+=a[k]; break; } for(int k=1;k<=n;k++){ string b=s+a[k]; if(press(b)==2){ s=b; break; } } for(int k=1;k<=n;k++){ string b=s+a[k]; if(press(b)==3){ s=b; break; } } return s; }

Compilation message (stderr)

combo.cpp:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string a="ABXY";
      | ^~~~~~
      | stdin
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:16: error: 'n' was not declared in this scope
    8 | for(int k=1;k<=n;k++)
      |                ^
combo.cpp:9:10: error: 'a' was not declared in this scope
    9 | if(press(a[k])==1){
      |          ^
combo.cpp:13:16: error: 'n' was not declared in this scope
   13 | for(int k=1;k<=n;k++){
      |                ^
combo.cpp:14:16: error: 'a' was not declared in this scope
   14 |     string b=s+a[k];
      |                ^
combo.cpp:20:16: error: 'n' was not declared in this scope
   20 | for(int k=1;k<=n;k++){
      |                ^
combo.cpp:21:16: error: 'a' was not declared in this scope
   21 |     string b=s+a[k];
      |                ^