제출 #286969

#제출 시각아이디문제언어결과실행 시간메모리
286969infinite_iq콤보 (IOI18_combo)C++14
5 / 100
1 ms200 KiB
#include <bits/stdc++.h> using namespace std ; #include "combo.h" int n ; string ans , but = "ABXY" , ret ; int query ( string s ) { return press (s) ; } void solve () { string crnt = "" ; for ( int i = 0 ; i < 3 ; i ++ ) { crnt += ans ; crnt += ret [0] ; crnt += ret [i] ; } crnt += ans ; crnt += ret [1] ; int x = query ( crnt ) ; x -= ans .size () ; if ( x == 0 ) { ans += ret [2] ; } if ( x == 1 ) { ans += ret [1] ; } if ( x == 2 ) { ans += ret [0] ; } } string guess_sequence ( int N ) { n = N ; if ( query ( "AB" ) ) { if ( query ( "A" ) ) ans += 'A' ; else ans += 'B' ; } else { if ( query ( "X" ) ) ans += 'X' ; else ans += 'Y' ; } for ( int i = 0 ; i < 4 ; i ++ ) { if ( but [i] != ans [0] ) ret += but [i] ; } for ( int i = 1 ; i < n - 1 ; i ++ ) solve () ; string crnt = "" ; crnt += ans ; crnt += ret [0] ; crnt += ans ; crnt += ret [1] ; if ( query ( crnt ) - ans .size () == 0 ) { ans += ret [2] ; } else { crnt = "" ; crnt += ans ; crnt += ret [0] ; if ( query ( crnt ) - ans .size () == 0 ) { ans += ret [1] ; } else ans += ret [0] ; } return ans ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...