제출 #293234

#제출 시각아이디문제언어결과실행 시간메모리
293234fire_cloud콤보 (IOI18_combo)C++14
30 / 100
71 ms576 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int n) { string caracteres[5]; caracteres[0]="BXY"; // sin A caracteres[1]="AXY"; // sin B caracteres[2]="ABY"; // sin X caracteres[3]="ABX"; // sin Y string inicial; string ss; int number; if(press("A") == 1){ inicial = "A"; } else{ if(press("B") == 1){ inicial = "B"; } else{ if(press("X") == 1 ){ inicial = "X"; } else{ inicial = "Y"; } } } // obtener caracter inicial if(inicial == "A") number = 0 ; if(inicial == "B") number = 1 ; if(inicial == "X") number = 2 ; if(inicial == "Y") number = 3 ; int i = 1; while(i <= n-1){ ss = inicial+caracteres[number][0]; ss+=inicial; //(inicial+caracteres[number][1]); // ojo con esto, capaz es primero ss+=inicial y luego ss += caracteres[number][1] ss+=caracteres[number][1]; if(press(ss) == i){ // == i, en vez de 1 inicial+=caracteres[number][2]; i++; } else{ ss = inicial+caracteres[number][0]; ss+= (inicial+caracteres[number][2]); if(press(ss) == i) { inicial+=caracteres[number][1]; } else{ inicial+=caracteres[number][0]; } i++; } } return inicial; // la respuesta a todo el problema }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...