제출 #1043803

#제출 시각아이디문제언어결과실행 시간메모리
1043803clementine콤보 (IOI18_combo)C++17
5 / 100
1 ms344 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { string S = ""; int ans = 0; string a, b, c; if(press("AB") >0) { if(press("A") == 1) { S = "A"; a = "B"; b = "X"; c = "Y"; } else { S= "B"; a = "A"; b = "X"; c = "Y"; } } else { if(press("X") > 0) { S = "X"; a = "B"; b = "A"; c = "Y"; } else { S = "Y"; a = "B"; b = "X"; c = "A"; } } string guess = ""; for(int i = 1; i <= N-2; i ++) { guess = S + a + b + S + a + c + S + a + a + S + b; ans = press(guess); if(ans == i) { S = S + c; } else if (ans == i + 1) { S = S + b; } else { S = S + a; } } guess = S + a; if(press(guess) == N) { S = S + a; } else { guess = S + b; if(press(guess) == N) { S = S + b; } else { S = S + c; } } //cout << S; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...