Submission #216485

#TimeUsernameProblemLanguageResultExecution timeMemory
216485T0p_Combo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;

string guess_sequence(int n)
{
	string s = "";
	int ab = press("AB");
	if(ab == 0)
	{
		if(press("X")) s += 'X';
		else s += 'Y';
	}
	else
	{
		if(press("A")) s += 'A';
		else s += 'B';
	}

	for(int i=2 ; i<=n ; i++)
	{
		string test = "";
		test += s;
		test += "XX";
		test += s;
		test += "XY";
		test += s;
		test += "XZ";
		test += s;
		test += "Y";
		test += s[0];
		int ret = press(test);
		if(ret == 0) s += 'Z';
		else if(ret == 1) s += 'Y';
		else s += 'X'; 
	}
	return s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...