제출 #100187

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1001872019-03-09 18:57:20SuperJumbo콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N){
string A = "A",B = "B",C = "X",D = "Y";
string ans;
if(press("AB")){
if(press("A"))ans = "A",swap(A,D);
else ans = "B",swap(B,D);
}
else {
if(press("X")) ans = "X",swap(C,D);
else ans = "Y";
}
for(int i = 1;i<= N-2;i++){
string query = ans + B + ans + C + A + ans + C + B + ans + C + C;
int res = press(query);
if (!res) ans = ans +A;
else if(res == 1) ans = ans + B;
else ans = ans + C;
}
int res = press(ans + A + B + ans + B + A);
if(res == 0){
res = press(ans + C + A + ans + C + B);
ans = ans + (res == 1 ? C + C : (press(ans + C + A) == 2 ? C + A : C + B));
}
else if (res == 2){
res = press(ans + A + B);
ans = ans + (res == 2 ? A + B : B + A);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...