Submission #145032

#TimeUsernameProblemLanguageResultExecution timeMemory
145032mhy908Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; typedef long long LL; string qu; char c[10]; string guess_sequence(int n) { if(press(qu+'A'))qu+='A', c[1]='B', c[2]='X', c[3]='Y'; else if(press(qu+'B'))qu+='B', c[1]='A', c[2]='X', c[3]='Y'; else if(press(qu+'X'))qu+='X', c[1]='B', c[2]='A', c[3]='Y'; else qu+='Y', c[1]='B', c[2]='X', c[3]='A'; for(int i=2; i<n; i++){ int temp=press(qu+c[1]+c[1]+qu+c[1]+c[2]+qu+c[1]+c[3]+qu+c[2]); if(temp==i+1)qu+=c[1]; if(temp==i)qu+=c[2]; if(temp==i-1)qu+=c[3]; } if(press(qu+c[1])==N)qu+=c[1]; else if(press(qu+c[2])==N)qu+=c[2]; else qu+=c[3]; return cu; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:24: error: 'N' was not declared in this scope
   19 |     if(press(qu+c[1])==N)qu+=c[1];
      |                        ^
combo.cpp:22:12: error: 'cu' was not declared in this scope; did you mean 'c'?
   22 |     return cu;
      |            ^~
      |            c