Submission #236873

#TimeUsernameProblemLanguageResultExecution timeMemory
236873michaoCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "combo.h" #define ll long long int #define mp make_pair #define pb push_back #define ld long double #define pii pair<int,int> #define sz(x) (int)x.size() #define piii pair<pii,pii> #define precise cout<<fixed<<setprecision(10) #define st first #define nd second #define ins insert #define vi vector<int> #define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) using namespace std; const char lit[4]={'X','Y','A','B'}; string guess_sequence(int n) { string ans=""; char first; int ile1=press("XY"); if (ile1) { if (press("X"))first='X'; else first='Y'; } else { if (press("A"))first='A'; else first='B'; } ans+=first; vector<char>unused; unused.clear(); for (int i=0;i<4;i++)if (lit[i]!=first)unused.pb(lit[i]); for (int i=0;i<n-1;i++) { string query=ans+unused[0]; int news=press(ans+unused[0]+ans+unused[1]+unused[0]+ans+unused[1]+unused[1]+ans +unused[1]+unused[2]); if (news==sz(ans)+1)ans+=unused[0]; else if (news==sz(ans)+2)ans+=unused[1]; else ans+=unused[2]; } return ans; } /* int32_t main() { BOOST; return 0; } */

Compilation message (stderr)

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