Submission #1279768

#TimeUsernameProblemLanguageResultExecution timeMemory
1279768tullCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { int p=0,r; char c[]={'A','B','X','Y'}; char sk,nt; string a=""; for(int i=0;i<4;++i){ char e=c[i]; nt=c[(i==3?0:i+1)]; r=press(a+e+nt); if(r>p){ a+=e; if(r-p==2){ a+=nt; ++p; nt='-'; } ++p; sk=e; break; } } while (p<N) { for(int i=0;i<4;++i){ char e=c[i]; if(e==sk or e==nt)continue; if(i!=3 and N-p>1)r=press(a+e+e); else if(i!=3 and N-p==1)r=press(a+e); else r=p+1; char nt=c[(i==3?0:i+1)]; if(r>p){ a+=e; if(r-p==2){ a+=nt; ++p; nt='-'; } ++p; break; } } } return a; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:7: error: 'press' was not declared in this scope
   11 |     r=press(a+e+nt);
      |       ^~~~~
combo.cpp:29:27: error: 'press' was not declared in this scope
   29 |       if(i!=3 and N-p>1)r=press(a+e+e);
      |                           ^~~~~
combo.cpp:30:33: error: 'press' was not declared in this scope
   30 |       else if(i!=3 and N-p==1)r=press(a+e);
      |                                 ^~~~~