Submission #1052276

#TimeUsernameProblemLanguageResultExecution timeMemory
1052276Ahmed57Combo (IOI18_combo)C++17
5 / 100
0 ms344 KiB
#include "bits/stdc++.h" #include "combo.h" using namespace std; string guess_sequence(int N){ int a = press("AB"); string fi; if(a){ if(press("A"))fi = "A"; else fi = "B"; }else{ if(press("X"))fi = "X"; else fi = "Y"; } set<char> rem; if(fi[0]!='X')rem.insert('X'); if(fi[0]!='A')rem.insert('A'); if(fi[0]!='B')rem.insert('B'); if(fi[0]!='Y')rem.insert('Y'); vector<char> v; for(auto i:rem)v.push_back(i); for(int i = 2;i<N;i++){ string qu; qu+=fi; qu+=v[0]; qu+=v[0]; qu+=fi; qu+=v[0]; qu+=v[1]; qu+=fi; qu+=v[0]; qu+=v[2]; qu+=fi; qu+=v[1]; int an = press(qu); if(an==i-1){ fi+=v[2]; }else if(an==i){ fi+=v[1]; }else fi+=v[0]; } string qu; qu+=fi; qu+=v[0]; qu+=fi; qu+=v[1]; if(press(qu)==N){ string qu2; qu2+=fi; qu2+=v[0]; if(press(qu2)==N){ fi+=v[0]; }else fi+=v[1]; }else fi+=v[2]; return fi; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...