Submission #961154

# Submission time Handle Problem Language Result Execution time Memory
961154 2024-04-11T15:18:06 Z raspy Combo (IOI18_combo) C++14
0 / 100
0 ms 344 KB
#include "combo.h"

using namespace std;

string guess_sequence(int n)
{
	char a[5] = {'A', 'B', 'X', 'Y'};
	string p = "";
	for (int i = 0; i < 3; i++)
	{
		p[0] = a[i];
		int odg = press(p);
		if (odg == 1)
		{
			swap(a[i], a[3]);
			break;
		}
		if (i == 3)
			p[0] = a[3];
	}
	char zc = p[0];
	string s = "";
	s += zc;
	for (int tr = 2; tr <= n; tr++)
	{
		p = s + a[0];
		p = p + s+a[1]+a[0];
		p = p + s+a[1]+a[2];
		p = p + s+a[1]+a[1];
		int odg = press(p);
		if (odg == tr)
			s += a[0];
		else if (odg == tr+1)
			s += a[1];
		else
			s += a[2];
	}
	return s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong Answer: invalid press
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -