Submission #800606

#TimeUsernameProblemLanguageResultExecution timeMemory
800606iskhakkutbilimCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define all(a) a.begin(), a.end() /* int press(string s){ return 1; } */ string guess_sequence(int N){ string ans = ""; if(press("A") == 1){ ans.push_back('A'); }else if(press("B") == 1){ ans.push_back('B'); }else if(press("X") == 1){ ans.push_back('X'); }else{ ans.push_back('Y'); } set<char> chars; chars.insert('A'); chars.insert('B'); chars.insert('X'); chars.insert('Y'); chars.erase(ans[0]); for(int i = 2;i <= N; i++){ for(char ch : chars){ if(press(ans+ch) == i){ ans.push_back(ch); break; } } } if((int)ans.size() != N) assert(false); return ans; } /* main(){ int n; cin >> n; cout << guess_sequence(n); return 0; } */

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:5: error: 'press' was not declared in this scope
   16 |  if(press("A") == 1){
      |     ^~~~~
combo.cpp:34:7: error: 'press' was not declared in this scope
   34 |    if(press(ans+ch) == i){
      |       ^~~~~