Submission #636984

#TimeUsernameProblemLanguageResultExecution timeMemory
636984bonk콤보 (IOI18_combo)C++14
Compilation error
0 ms0 KiB
string guess_sequence(int n){ char fi = ' '; if(press("A")) fi = 'A'; else if(press("B")) fi = 'B'; else if(press("X")) fi = 'X'; else fi = 'Y'; string ans = ""; ans += fi; int len = 1; while(len < n){ if(fi != 'A' && (press(ans + 'A')) == len + 1) ans += 'A'; else if(fi != 'B' && (press(ans + 'B')) == len + 1) ans += 'B'; else if(fi != 'X' && (press(ans + 'X')) == len + 1) ans += 'X'; else ans += 'Y'; len++; } return ans; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; cout << guess_sequence(n) << '\n'; return 0; }

Compilation message (stderr)

combo.cpp:1:1: error: 'string' does not name a type
    1 | string guess_sequence(int n){
      | ^~~~~~
combo.cpp: In function 'int main()':
combo.cpp:24:5: error: 'ios_base' has not been declared
   24 |     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |     ^~~~~~~~
combo.cpp:24:35: error: 'cin' was not declared in this scope
   24 |     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                   ^~~
combo.cpp:24:47: error: 'cout' was not declared in this scope
   24 |     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      |                                               ^~~~
combo.cpp:26:13: error: 'guess_sequence' was not declared in this scope
   26 |     cout << guess_sequence(n) << '\n';
      |             ^~~~~~~~~~~~~~