제출 #199208

#제출 시각아이디문제언어결과실행 시간메모리
199208joylintp콤보 (IOI18_combo)C++17
30 / 100
70 ms448 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string ret; set<char> but = {'A', 'B', 'X', 'Y'}; auto pos = but.begin(); for (int j = 0; j < 3; j++, pos++) if (press(ret + *pos) == 1) { ret += *pos; break; } if (ret.empty()) ret = "Y"; but.erase(ret[0]); for (int i = 1; i < n; i++) { bool suc = false; pos = but.begin(); for (int j = 0; j < 2 && !suc; j++, pos++) if (press(ret + *pos) == (int)ret.size() + 1) { ret += *pos; suc = true; } if (!suc) ret += *prev(but.end()); } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...