Submission #802414

#TimeUsernameProblemLanguageResultExecution timeMemory
802414Gabi88Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; /* int press(string a){ int x; cout << a << endl; cin >> x; return x; }*/ string guess_sequence(int n){ string s; vector<char> v; int t = press("AB"); int pos = 2; if (t > 0){ t = press("A"); if (t == 1){ s = "A"; v.push_back('B'); v.push_back('X'); v.push_back('Y');} else{ s = "B"; v.push_back('A'); v.push_back('X'); v.push_back('Y'); } }else{ t = press("X"); if (t == 1){ s = "X"; v.push_back('A'); v.push_back('B'); v.push_back('Y'); } else{ s = "Y"; v.push_back('A'); v.push_back('B'); v.push_back('X'); } } while(pos < n){ t = press(s+v[0]+s+v[1]+v[0]+s+v[1]+v[1]+s+v[1]+v[2]); if (t == pos-1) s += v[2]; else if (t == pos) s += v[0]; else s += v[1]; pos++; } for(int i=0; i<2; i++){ t = press(s+v[i]); if (t == pos){ pos++; s += v[i]; } } if (pos == n) s += v[2]; return s; }/* int main(){ int n; cin >> n; cout << "-> " << guess_sequence(n) << endl; }*/

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:10: error: 'press' was not declared in this scope
   11 |  int t = press("AB");
      |          ^~~~~