Submission #171064

#TimeUsernameProblemLanguageResultExecution timeMemory
171064Nodir_BobievCombo (IOI18_combo)C++11
5 / 100
2 ms256 KiB
# include "combo.h"
# include <bits/stdc++.h>
using namespace std;

string guess_sequence( int N ){
	string S;
	if( press("AB") ){
		if( press("A") ){
			S = "A";
		}
		else{
			S = "B";
		}
	}else{
		if( press( "X" ) ){
			S = "X";
		}
		else{
			S = "Y";
		}
	}
	set < char > st = { 'A', 'B', 'X', 'Y' };
	st.erase( S[0] );
	vector < char > vc;
	for( auto c: st ) vc.push_back( c );

	for( int i = 2; i <= N-1; i ++ ){
		string p = S + vc[0] + S + vc[1] + vc[0] + S + vc[1] + vc[1]+ S + vc[1] + vc[2];
		int x = press( p );
		if( x == i ){
			S += vc[0];
		}
		else if( x == i+1 ){
			S += vc[1];
		}
		else{
			S += vc[2];
		}
	}
	if( press( S+vc[0] ) == N ){
		S += vc[0];
	}
	else if( press( S+vc[1] ) == N ){
		S += vc[1];
	}
	else{
		S += vc[2];
	}
	return S;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...