제출 #1052280

#제출 시각아이디문제언어결과실행 시간메모리
1052280Ahmed57콤보 (IOI18_combo)C++17
100 / 100
24 ms2024 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]; } if(N==1)return fi; 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...