제출 #990030

#제출 시각아이디문제언어결과실행 시간메모리
990030TitanicXDzz콤보 (IOI18_combo)C++14
5 / 100
1 ms344 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { std::string p = "AB"; int coins = press(p); if(coins>=1){ string s="A"; coins=press(s); if(coins==1){ p="A"; for(int i=2;i<N;i++){ s=p+"BB"+p+"BX"+p+"BY"+p+"X"; coins=press(s); if(coins==i+1) p+="B"; else if(coins==i) p+="X"; else p+="Y"; } s=p+"B"; coins=press(s); if(coins==N) p=s; else{ s=p+"X"; coins=press(s); if(coins==N) p=s; else p+="Y"; } } else{ p="B"; for(int i=2;i<N;i++){ s=p+"AA"+p+"AX"+p+"AY"+p+"X"; coins=press(s); if(coins==i+1) p+="A"; else if(coins==i) p+="X"; else p+="Y"; } s=p+"A"; coins=press(s); if(coins==N) p=s; else{ s=p+"X"; coins=press(s); if(coins==N) p=s; else p+="Y"; } } } else{ string s="X"; coins=press(s); if(coins==1){ p="X"; for(int i=2;i<N;i++){ s=p+"BB"+p+"BA"+p+"BY"+p+"A"; coins=press(s); if(coins==i+1) p+="B"; else if(coins==i) p+="A"; else p+="Y"; } s=p+"B"; coins=press(s); if(coins==N) p=s; else{ s=p+"A"; coins=press(s); if(coins==N) p=s; else p+="Y"; } } else{ p="Y"; for(int i=2;i<N;i++){ s=p+"AA"+p+"AX"+p+"AB"+p+"X"; coins=press(s); if(coins==i+1) p+="A"; else if(coins==i) p+="X"; else p+="B"; } s=p+"A"; coins=press(s); if(coins==N) p=s; else{ s=p+"X"; coins=press(s); if(coins==N) p=s; else p+="B"; } } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...