# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
234029 | Binyomin | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std ;
string guess_sequence(int N) {
vector < char > a = { 'A', 'B', 'X', 'Y' } ;
char x ;
string ans = "", p = "";
int cnt = 0 , ok = 0 ;
while( cnt != N ) {
for( int i = 0 ; i < 4 ; i ++ ) {
if( ok && x == a[i] ) continue ;
p = ans + a[i] ;
int tt = press( p );
if( tt > cnt ) {
cnt ++ ;
ans += a[i] ;
if( !ok ) {
ok = 1;
x = a[i] ;
}
}
}
}
return ans ;
}
int main() {
int N ;
cin >> N ;
guess_sequence(N) ;
}