제출 #1049191

#제출 시각아이디문제언어결과실행 시간메모리
1049191MrDogMeat콤보 (IOI18_combo)C++17
10 / 100
33 ms1112 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int N) { string res = ""; vector<char> vec = {'A', 'B', 'X'}; if(press("AB") >= 1) { if(press("A") == 1) { res += 'A'; vec.erase(vec.begin()); } else { res += 'B'; vec.erase(vec.begin() + 1); } } else { if(press("X") == 1) { res += 'X'; vec.erase(vec.begin() + 2); } else { res += 'Y'; } } for(int i = 2; i <= N; i++) { bool flag = false; for(auto e : vec) if(press(res + e) == i) { res += e; flag = true; break; } if(flag) continue; res += 'Y'; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...