제출 #167328

#제출 시각아이디문제언어결과실행 시간메모리
167328muhammad_hokimiyon콤보 (IOI18_combo)C++14
100 / 100
42 ms844 KiB
#include "combo.h" # include <bits/stdc++.h> using namespace std; string guess_sequence( int N ) { string s; vector < string > t; if( press( "AB" ) > 0 ){ if( press( "A" ) == 1 ){ s = "A"; t = { "B" , "X" , "Y" }; } else{ s = "B"; t = { "A" , "X" , "Y" }; } } else{ if( press( "X" ) == 1 ){ s = "X"; t = { "A" , "B" , "Y" }; } else{ s = "Y"; t = { "A" , "B" , "X" }; } } if( N == 1 )return s; for( int i = 1; i < N - 1; i++ ){ string g = s + t[0] + s + t[1] + t[0] + s + t[1] + t[1] + s + t[1] + t[2]; int c = press(g); if( c == i )s += t[2]; else if( c == i + 1 )s += t[0]; else s += t[1]; } if( press( s + "A" + s + "B" ) == N ){ if( press( s + "A" ) == N ){ s += "A"; } else{ s += "B"; } } else{ if( press( s + "X" ) == N ){ s += "X"; } else{ s += "Y"; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...