Submission #301909

#TimeUsernameProblemLanguageResultExecution timeMemory
301909lohachoCombo (IOI18_combo)C++14
100 / 100
42 ms672 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; using LL = long long; const int INF = (int)1e9 + 7; const int NS = (int)2e3 + 4; std::string guess_sequence(int N) { string ans, can; if(press("AB")){ if(press("A")) ans += "A", can = "BXY"; else ans += "B", can = "AXY"; } else{ if(press("X")) ans += "X", can = "ABY"; else ans += "Y", can = "ABX"; } for(int i = 2; i <= N; ++i){ if(i < N){ int rv = press(ans + can[0] + ans + can[1] + can[0] + ans + can[1] + can[1] + ans + can[1] + can[2]); if(rv == i) ans += can[0]; else if(rv == i + 1) ans += can[1]; else ans += can[2]; } else{ int rv = press(ans + can[0]); if(rv == i) ans += can[0]; else{ rv = press(ans + can[1]); if(rv == i) ans += can[1]; else ans += can[2]; } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...