제출 #232647

#제출 시각아이디문제언어결과실행 시간메모리
232647pere_gil콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include <iostream> using namespace std; std::string guess_sequence(int N){ string s="",rest=""; if(press("AB")>0){ if(press("A")>0){ s="A"; rest="BXY"; } else{ s="B"; rest="AXY"; } } else{ if(press("X")>0){ s="X"; rest="ABY"; } else{ s="Y"; rest="ABX"; } } int c=1; while(c<N-1){ string supose=s+rest[0]+rest[0]+s+rest[0]+rest[1]+s+rest[0]+rest[2]+s+rest[1]; int a=press(supose); if(a==c+2){ s+=rest[0]; } else{ if(a==c+1){ s+rest[1]; } else{ if(a==c){ s+=rest[2]; } } } supose=""; c++; } if(press(s+rest[0])>c){ s+=rest[0]; c++; } else{ if(press(s+rest[1])>c){ s+=rest[1]; } else{ s+=rest[2]; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...