Submission #862860

#TimeUsernameProblemLanguageResultExecution timeMemory
86286020163070Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; std::string guess_sequence(int n) { string ans,s; if(press("AB")) { if(press("A")) ans="A",s="BXY"; else ans="B",s="AXY"; } else { if(press("X")) ans+="X",s="ABY"; else ans+="Y",s="ABX" } if(n==1) return ans; for(int i=2;i<n;i++) { string t=ans+s[0]+ans+s[1]+s[0]+ans+s[1]+s[1]+ans+s[1]+s[2]; int get=press(t); if(get==i-1) ans+=s[2]; else if(get==i) ans+=s[0]; else ans+=s[1]; } if(press(ans+s[0])==n) ans+=s[0]; else if(press(ans+s[1])==n) ans+=s[1]; else ans+=s[2]; return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:24: error: expected ';' before '}' token
   15 |   else ans+="Y",s="ABX"
      |                        ^
      |                        ;
   16 |  }
      |  ~