Submission #601262

#TimeUsernameProblemLanguageResultExecution timeMemory
601262FidanCombo (IOI18_combo)C++17
5 / 100
1 ms292 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; typedef int ll; vector<char> v(3); string guess_sequence(int n) { string s; ll k1=press("A"), k2=press("B"), k3=press("X"); if(k1==1){ v[0]='B', v[1]='X', v[2]='Y'; s="A"; } else if(k2==1){ v[0]='A', v[1]='X', v[2]='Y'; s="B"; } else if(k3==1){ v[0]='A', v[1]='B', v[2]='Y'; s="X"; } else{ v[0]='A', v[1]='B', v[2]='X'; s="Y"; } string p; for(ll i=1; i<=n-2; i++){ p=s+v[0]+s+v[1]+v[0]+s+v[1]+v[1]+s+v[1]+v[2]; ll k=press(p); if(k==i){ s+=v[2]; } else if(k==i+1){ s+=v[0]; } else{ s+=v[1]; } } ll l1=press(s+v[0]); if(l1==n) s+=v[0]; else{ ll l2=press(s+v[1]); if(l2==n) s+=v[1]; else s+=v[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...