제출 #1084007

#제출 시각아이디문제언어결과실행 시간메모리
1084007vladilius콤보 (IOI18_combo)C++17
100 / 100
25 ms2004 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; using ll = long long; using pii = pair<int, int>; #define pb push_back #define ff first #define ss second #define ins insert vector<string> f = {"A", "B", "X", "Y"}; string guess_sequence(int n){ int x; string s; if (press("AB")){ if (press("A")){ x = 0; s = "A"; } else { x = 1; s = "B"; } } else { if (press("X")){ x = 2; s = "X"; } else { x = 3; s = "Y"; } } if (n == 1) return s; f.erase(f.begin() + x); for (int i = 1; i < n - 1; i++){ string p = s + f[1]; for (int j = 0; j < 3; j++){ p += (s + f[2] + f[j]); } int k = press(p) - (int) s.size(); s += f[k]; } string p = s + f[0]; if (press(p) == n){ s += f[0]; } else { p = s + f[1]; if (press(p) == n){ s += f[1]; } else { s += f[2]; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...