제출 #840773

#제출 시각아이디문제언어결과실행 시간메모리
840773ach00콤보 (IOI18_combo)C++17
5 / 100
1 ms256 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string letters = "ABXY"; string ans; int n; char first; char one; char two; char remain; string t1,t2,t3; char next() { int val = press((ans + one) + (ans + t1) + (ans + t2) + (ans + t3)); if(val == (int)ans.size()) { return remain; } else if(val == (int)ans.size() + 1) { return one; } else { return two; } } string guess_sequence(int N) { n = N; if(press("AB")) { if(press("A")) { first = 'A'; one = 'B'; two = 'X'; remain = 'Y'; t1 = "XB"; t2 = "XY"; t3 = "XX"; } else { first = 'B'; one = 'A'; two = 'X'; remain = 'Y'; t1 = "XA"; t2 = "XY"; t3 = "XX"; } } else { if(press("X")) { first = 'X'; one = 'A'; two = 'B'; remain = 'Y'; t1 = "BA"; t2 = "BY"; t3 = "BB"; } else { first = 'Y'; one = 'A'; two = 'B'; remain = 'X'; t1 = "BA"; t2 = "BX"; t3 = "BB"; } } ans += first; while((int)ans.size() != N-1) { ans += next(); } if(press((ans+one)+(ans+two)) == N) { if(press(ans+one) == N) { ans += one; } else { ans += two; } } else { ans += remain; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...