Submission #232655

#TimeUsernameProblemLanguageResultExecution timeMemory
232655pere_gilCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" #include <iostream> using namespace std; std::string guess_sequence(int N){ string s="",rest="",supose=""; if(press("AB")>0){ if(press("A")>0){ s="A"; rest="BXY"; } else{ s="B"; rest="AXY"; } } else{ if(press("X")>0){ s="X"; rest="ABY"; } else{ s="Y"; rest="ABX"; } } //-------------------------------------------------------------------// int c=1; while(c<N-1){ supose= s+rest[0]+rest[0]+ s+rest[0]+rest[1]+ s+rest[0]+rest[2]+ s+rest[1]; int a=press(supose); if(a>=c+2){ s+=rest[0] } if(a==c+1) { s+=rest[1] } if(a==){ s+=rest[2] } supose=""; c++; } //------------------------------------------------------------------// if(N==1){ return s; } else{ if(press(s+rest[0])>c){ s+=rest[0]; } else{ if(press(s+rest[1])>c){ s+=rest[1] } else{ s+=rest[2] } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:33:31: error: expected ';' before '}' token
   33 |         if(a>=c+2){ s+=rest[0] }
      |                               ^~
      |                               ;
combo.cpp:34:32: error: expected ';' before '}' token
   34 |         if(a==c+1) { s+=rest[1] }
      |                                ^~
      |                                ;
combo.cpp:35:15: error: expected primary-expression before ')' token
   35 |         if(a==){ s+=rest[2] }
      |               ^
combo.cpp:35:28: error: expected ';' before '}' token
   35 |         if(a==){ s+=rest[2] }
      |                            ^~
      |                            ;
combo.cpp:46:47: error: expected ';' before '}' token
   46 |             if(press(s+rest[1])>c){ s+=rest[1] }
      |                                               ^~
      |                                               ;
combo.cpp:47:29: error: expected ';' before '}' token
   47 |             else{ s+=rest[2] }
      |                             ^~
      |                             ;