제출 #750219

#제출 시각아이디문제언어결과실행 시간메모리
750219cheat_when_I_was_young콤보 (IOI18_combo)C++17
0 / 100
0 ms208 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { int coins; vector<char> c = {'A', 'B', 'X', 'Y'}; string ans = ""; /* coins = press(ans + "AB" + ans + "BA"); if (coins) { coins = press(ans + "A"); if (coins) ans += "A"; else ans += "B"; } else { coins = press(ans + "X"); if (coins) ans += "X"; else ans += "Y"; } */ for (int j = 0; j < n; ++j) { for (int i = 0; i < 4; ++i) { coins = press(ans + c[i]); if (coins) { ans += c[i]; break; } } } /* vector<string> d, e; if (ans == "A") { d = {"B", "XB", "XX", "XY"}; e = {"Y", "B", "X"}; } else if (ans == "B") { d = {"A", "XA", "XX", "XY"}; e = {"Y", "A", "X"}; } else if (ans == "X") { d = {"A", "YA", "YB", "YY"}; e = {"B", "A", "Y"}; } else { d = {"A", "XA", "XB", "XX"}; e = {"B", "A", "X"}; } while (ans.size() < n-1) { coins = press(ans + d[0] + ans + d[1] + ans + d[2] + ans + d[3]); ans += e[coins - ans.size()]; } for (int i = 0; i < 4; ++i) { coins = press(ans + c[i]); if (coins) { ans += c[i]; break; } } */ return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...