Submission #514845

# Submission time Handle Problem Language Result Execution time Memory
514845 2022-01-18T14:49:19 Z rajatshenoi Colors (BOI20_colors) C++14
0 / 100
0 ms 200 KB
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
	int N;
	cin >> N;

	int j = 0;
	int k = 1;

	for (int i = 1; i <= N; i++)
	{
		if (i % 2 == 1)
		{
			cout << "? " << k << endl;
			int ans;
			cin >> ans;

			if (ans == 0)
			{
				cout << "= " << (N - i) << endl;
				break;
			}
			k++;
		}
		else
		{
			cout << "? " << (N - j) << endl;
			int ans;
			cin >> ans;

			if (ans == 0)
			{
				cout << "= " << (N - i) << endl;
				break;
			}
			j++;
		}
	}

	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Wrong guess
2 Halted 0 ms 0 KB -