Submission #299595

#TimeUsernameProblemLanguageResultExecution timeMemory
299595BatyrCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> //#include "combo.h" using namespace std; #define pb push_back #define ff first #define ss second #define sz(a) (int)a.size() typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pii; const ll inf=1e18; const int mod=1e9+7; const int maxn=1e5; string s; vector<char>v; string guess_sequence(int N){ int jog = press("AB"); if(jog==2) s+='A'; else if(jog==1){ if(press("A")==1) s += 'A'; else s += 'B'; } else { if(press("X")==1) s += 'X'; else s += 'Y'; } if(s[0]=='A') v={'B','X','Y'}; else if(s[0]=='B') v={'A','X','Y'}; else if(s[0]=='X') v={'A','B','Y'}; else v={'A','B','X'}; for(int i = 1;i < N;i++){ string ask=""; ask += s+v[0]+v[0]; ask += s+v[0]+v[1]; ask += s+v[0]+v[2]; ask += s+v[1]; int now=press(ask); if(now==sz(s)+2) s+=v[0]; else if(now==sz(s)+1) s+=v[1]; else s+=v[2]; } if(press(s+v[0])==sz(s)+1) s += v[0]; else if(press(s+v[1])==sz(s)+1) s += v[1]; else s += v[2]; return s; }

Compilation message (stderr)

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