Submission #236990

#TimeUsernameProblemLanguageResultExecution timeMemory
236990kai824Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include"combo.h" #include"bits/stdc++.h" using namespace std; string guess_sequence(int n){ string cur,choices="",abxy="ABXY",t; if(press("AB")>0){ if(press("A")>0)cur="A"; else cur="B"; }else{ if(press("X")>0)cur="X"; else cur="Y"; } if(n==1)return cur; for(int i=0;i<4;i++){ if(cur[0]==abxy[i])continue; choices+=abxy[i]; } int k; for(int i=1;i<n-1;i++){ t=""; for(int j=0;j<3;j++)t+=cur+choices[0]+choices[j]; k=press(t+cur+choices[1]); if(k==i)cur+=choices[2]; else if(k==i+1)cur+=choices[1]; else{ cur+=choices[0]; } } if(press(cur+choices[0])==n){ return cur+choices[0] }else{ if(press(cur+choices[1])==n)return cur+choices[1]; else return cur+choices[2]; } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:30:26: error: expected ';' before '}' token
   30 |     return cur+choices[0]
      |                          ^
      |                          ;
   31 |   }else{
      |   ~