Submission #367800

#TimeUsernameProblemLanguageResultExecution timeMemory
367800mashrur_hossainCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n){ string s = ""; string a = "ABXY"; if(press("AB")){ if(press("A")){ a.erase(a.begin()); s+="A"; } else{ a.erase(a.begin()+1); s+="B"; } } else{ if(press("X")){ a.erase(a.begin()+2); s+='X'; } else{ s+="Y"; a.erase(a.begin()+3); } } // D(s); for(int i = 1;i<n-1;i++){ string guess = ""; for(int j = 0;j<4;j++){ guess+= s + a[0] + a[j]; } guess+=s+a[1]; int x = press(guess); if(x == i)s+=a[2]; else if(x==i+1)s+=a[1]; else if(x==i+2)s+=a[0]; } if(press(s+a[0]+s+a[1]) == n){ if(press(s+a[0]) == n){ s+= a[0]; }else{ s+=a[1]; } } else{ s+=a[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...