Submission #199988

# Submission time Handle Problem Language Result Execution time Memory
199988 2020-02-04T16:22:57 Z Mr_turtle Combo (IOI18_combo) C++14
5 / 100
2 ms 300 KB
#include "combo.h"
using namespace std;
string ans;
string rest;
string guess_sequence(int n) {
	string a = "AB";
	if (press(a))
	{
		a = "A";
		if (press(a))
			ans = "A";
		else
			ans = "B";
	}
	else
	{
		a = "X";
		if (press(a))
			ans = "X";
		else
			ans = "Y";
	}
	rest = "";
	for (int i = 0;i < 4;i++)
	{
		if ("ABXY"[i] == ans[0]) continue;
		rest += "ABXY"[i];
	}
	for (int i = 2;i < n;i++)
	{
		int prs = press(ans + rest[1] + ans + rest[2] + rest[0] + ans + rest[2] + rest[1] + ans + rest[2] + rest[2]);
		prs -= (i - 1);
		ans += rest[prs];
	}
	if (press(ans + "A" + ans + "B") == n)
	{
		if (press(ans + "A") == n)
			ans += "A";
		else
			ans += "B";
	}
	else
	{
		if (press(ans + "X") == n)
			ans += "X";
		else
			ans += "Y";
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 2 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 2 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 2 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 1 ms 200 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
11 Correct 1 ms 200 KB Output is correct
12 Correct 2 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 1 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Correct 1 ms 200 KB Output is correct
17 Correct 1 ms 200 KB Output is correct
18 Correct 1 ms 200 KB Output is correct
19 Correct 1 ms 200 KB Output is correct
20 Correct 1 ms 200 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 1 ms 200 KB Output is correct
24 Correct 1 ms 200 KB Output is correct
25 Correct 1 ms 200 KB Output is correct
26 Correct 1 ms 200 KB Output is correct
27 Correct 2 ms 200 KB Output is correct
28 Correct 1 ms 200 KB Output is correct
29 Correct 1 ms 200 KB Output is correct
30 Correct 1 ms 200 KB Output is correct
31 Correct 1 ms 200 KB Output is correct
32 Correct 1 ms 200 KB Output is correct
33 Correct 1 ms 200 KB Output is correct
34 Correct 2 ms 200 KB Output is correct
35 Correct 2 ms 200 KB Output is correct
36 Correct 1 ms 216 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Wrong Answer: wrong guess.
2 Halted 0 ms 0 KB -