Submission #514851

# Submission time Handle Problem Language Result Execution time Memory
514851 2022-01-18T15:01:02 Z rajatshenoi Colors (BOI20_colors) C++14
0 / 100
1 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++)
	{
		// cout << "i=" << i << endl;
		if (i % 2 == 1)
		{
			cout << "? " << k << endl;
			int ans;
			cin >> ans;

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

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

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB OK (5 queries)
2 Correct 0 ms 200 KB OK (6 queries)
3 Correct 0 ms 200 KB OK (10 queries)
4 Incorrect 1 ms 200 KB Unexpected end of file - token expected
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB OK (5 queries)
2 Correct 0 ms 200 KB OK (6 queries)
3 Correct 0 ms 200 KB OK (10 queries)
4 Incorrect 1 ms 200 KB Unexpected end of file - token expected
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB OK (5 queries)
2 Correct 0 ms 200 KB OK (6 queries)
3 Correct 0 ms 200 KB OK (10 queries)
4 Incorrect 1 ms 200 KB Unexpected end of file - token expected
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB OK (5 queries)
2 Correct 0 ms 200 KB OK (6 queries)
3 Correct 0 ms 200 KB OK (10 queries)
4 Incorrect 1 ms 200 KB Unexpected end of file - token expected
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB OK (5 queries)
2 Correct 0 ms 200 KB OK (6 queries)
3 Correct 0 ms 200 KB OK (10 queries)
4 Incorrect 1 ms 200 KB Unexpected end of file - token expected
5 Halted 0 ms 0 KB -