Submission #1271601

#TimeUsernameProblemLanguageResultExecution timeMemory
1271601david_g611Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { char first; if(press("AB")) { if(press("A")) first='A'; else first='B'; } else { if(press("X")) first='X'; else first='Y'; } string s=""; s+=first; char f1, f2, f3; if(first=='A')f1='B', f2='X', f3='Y'; if(first=='B')f1='A', f2='X', f3='Y'; if(first=='X')f1='B', f2='Y', f3='A'; if(first=='Y')f1='B', f2='X', f3='A'; for(int i=2; i<=N-1; i++) { string p=""; p+=s;p+=f1;p+=f1; p+=s;p+=f1;p+=f2; p+=s;p+=f1;p+=f3; p+=s;p+=f2; int creste=press(p)-s.size(); if(creste==2)s+=f1; if(creste==1)s+=f2; if(creste==0)s+=f3; } string p=""; p=s+f1+s+f2; if(press(p) == N) { p=s+f1; if(press(p)==N) s+=f1; else s+=f2; } else s+=f3; return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:8: error: 'press' was not declared in this scope
    8 |     if(press("AB"))
      |        ^~~~~
combo.cpp:37:20: error: 'press' was not declared in this scope
   37 |         int creste=press(p)-s.size();
      |                    ^~~~~
combo.cpp:44:8: error: 'press' was not declared in this scope
   44 |     if(press(p) == N)
      |        ^~~~~