제출 #203393

#제출 시각아이디문제언어결과실행 시간메모리
2033930gnjen콤보 (IOI18_combo)C++14
5 / 100
2 ms256 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; std::string guess_sequence(int N) { //cout << N << endl; string s = ""; string c = "ABXY"; if(press("AB")) { if(press("A")) { s += 'A'; c = "BXY"; } else { s += 'B'; c = "AXY"; } } else { if(press("X")) { s += 'X'; c = "ABY"; } else { s += 'Y'; c = "ABX"; } } for(int i = 1; i < N-1; i++) { string ask1 = s ; ask1+=c[0]; ask1+=s; ask1+=c[1]; ask1+=c[0]; ask1+=s; ask1+=c[1]; ask1+=c[1]; ask1+=s; ask1+=c[1]; ask1+=c[2]; int ans =press(ask1); if(ans==i)s+=c[2]; else if(ans==i+1)s+=c[0]; else s+=c[1]; } if(press(s+c[0]) == N) { s += c[0]; } else if(press(s+c[1]) == N) s += c[1]; else s += c[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...