Submission #440283

#TimeUsernameProblemLanguageResultExecution timeMemory
440283julian33Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define deb(...) logger(#__VA_ARGS__, __VA_ARGS__) template<typename ...Args> void logger(string vars, Args&&... values) { cerr<<vars<<" = "; string delim=""; (...,(cerr<<delim<<values,delim=", ")); cerr<<"\n"; } #else #define deb(...) logger(#__VA_ARGS__, __VA_ARGS__) template<typename ...Args> void logger(string vars, Args&&... values) {} #endif #define pb push_back #define sz(x) (int)(x.size()) typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; template<typename T> inline void maxa(T& a,T b){a=max(a,b);} template<typename T> inline void mina(T& a,T b){a=min(a,b);} // int press(string p){ // deb(p); // string pref=S; // while(sz(pref)){ // if(p.find(pref)!=string::npos){ // deb(pref); // return sz(pref); // } // pref.pop_back(); // } // return 0; // } string guess_sequence(int N){ string res=""; while(sz(res)!=N){ int num=press(res+'A'+res+'B'); if(num>sz(res)){ int a=press(res+'A'); if(a>sz(res)) res+='A'; else res+='B'; } else{ int x=press(res+'X'); if(x>sz(res)) res+='X'; else res+='Y'; } } return res; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:44:17: error: 'press' was not declared in this scope; did you mean 'res'?
   44 |         int num=press(res+'A'+res+'B');
      |                 ^~~~~
      |                 res