제출 #422018

#제출 시각아이디문제언어결과실행 시간메모리
422018Dilshod_Imomov콤보 (IOI18_combo)C++17
97 / 100
48 ms740 KiB
# include <bits/stdc++.h> # include "combo.h" using namespace std; string guess_sequence(int n) { string s, t; if ( press("A") ) { s = "A"; t = "BXY"; } else if ( press("B") ) { s = "B"; t = "AXY"; } else if ( press("X") ) { s = "X"; t = "ABY"; } else { s = "Y"; t = "ABX"; } if ( n == 1 ) { return s; } int cur = 1; for ( int i = 1; i < n - 1; i++ ) { string k = s; k += t[0]; for ( int j = 0; j < 3; j++ ) { k += s + t[1] + t[j]; } int get = press(k); if ( get == cur ) { s += t[2]; } else if ( get == cur + 1 ) { s += t[0]; } else { s += t[1]; } cur++; } if ( press( s + t[0] ) == cur + 1 ) { s += t[0]; } else if ( press( s + t[1] ) == cur + 1 ) { s += t[1]; } else { s += t[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...