Submission #1049191

#TimeUsernameProblemLanguageResultExecution timeMemory
1049191MrDogMeatCombo (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...