제출 #236985

#제출 시각아이디문제언어결과실행 시간메모리
236985kai824콤보 (IOI18_combo)C++17
5 / 100
1 ms200 KiB
#include"combo.h" #include"bits/stdc++.h" using namespace std; string guess_sequence(int n){ string cur,choices="",abxy="ABXY",t; if(press("AB")>0){ if(press("A")>0)cur="A"; else cur="B"; }else{ if(press("X")>0)cur="X"; else cur="Y"; } for(int i=0;i<4;i++){ if(cur[0]==abxy[i])continue; choices+=abxy[i]; } int k; for(int i=1;i<n-1;i++){ t=""; for(int j=0;j<3;j++)t+=cur+choices[0]+choices[j]; k=press(t+cur+choices[1]); if(k==i)cur+=choices[2]; else if(k==i+1)cur+=choices[1]; else if(k==i+2){ cur+=choices[0]; }else{ while(true){};; } } if(press(cur+"A"+cur+"B")==n){ if(press(cur+"A")==n)return cur+"A"; else return cur+"B"; }else{ if(press(cur+"X")==n)return cur+"X"; else return cur+"Y"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...