Submission #1098708

#TimeUsernameProblemLanguageResultExecution timeMemory
1098708aren_danceCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int press(string p); string guess_sequence(int N){ int n=N; string s=""; string l1=""; l1+='A'; string l2=""; string l3=""; l2+='B'; l3+='X'; char c=; if(press(l1)==1){ s+=l1; c='A'; } else if(press(l2)==1){ s+=l2; c='B'; } else if(press(l3)==1){ s+=l3; c='X'; } else{ s+='Y'; C='Y'; } for(int i=1;i<=n;++i){ if(c=='A'){ string vec=s+'B'+s+'B'+s+'X'; int kal=press(vec); if(kal==0){ s+='Y'; } if(kal==1){ s+='X'; } if(kal==2){ s+='B'; s+='B'; } } if(c=='B'){ string vec=s+'A'+s+'A'+s+'X'; int kal=press(vec); if(kal==0){ s+='Y'; } if(kal==1){ s+='X'; } if(kal==2){ s+='A'; } } if(c=='X'){ string vec=s+'A'+s+'A'+s+'B'; int kal=press(vec); if(kal==0){ s+='Y'; } if(kal==1){ s+='B'; } if(kal==2){ s+='A'; } } if(c=='Y'){ string vec=s+'A'+s+'A'+s+'B'; int kal=press(vec); if(kal==0){ s+='X'; } if(kal==1){ s+='B'; } if(kal==2){ s+='A'; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:12: error: expected primary-expression before ';' token
   13 |     char c=;
      |            ^
combo.cpp:28:9: error: 'C' was not declared in this scope
   28 |         C='Y';
      |         ^