Submission #130129

#TimeUsernameProblemLanguageResultExecution timeMemory
130129HungAnhGoldIBO2020Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<iostream> #include "combo.h" using namespace std; char ohyeah[]={'X','Y','A','B'}; char lis[5]; string guess_sequence(int N){ string cac="",cac1; if(press("AB")){ if(press("A")){ cac+='A'; } else{ cac+='B'; } } else{ if(press("X")){ cac+='X'; } else{ cac+='Y'; } } if(N==1){ return cac; } int i,j=0; for(i=0;i<4;i++){ if(s[i]!=cac[0]){ j++; lis[j]=s[i]; } } for(i=1;i<N-1;i++){ cac1=cac+lis[1]+cac+lis[2]+lis[3]+cac+lis[2]+lis[1]+cac+lis[2]+lis[2]; j=press(cac1); if(j==i+1){ cac+=lis[1]; } else{ if(j==i){ cac+=lis[3]; } else{ cac+=lis[2]; } } } if(press(cac+lis[1])==N){ return cac+lis[1]; } if(press(cac+lis[2])==N){ return cac+lis[2]; } return cac+lis[3]; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:29:6: error: 's' was not declared in this scope
   29 |   if(s[i]!=cac[0]){
      |      ^