Submission #111464

# Submission time Handle Problem Language Result Execution time Memory
111464 2019-05-15T12:22:52 Z diamond_duke Koala Game (APIO17_koala) C++11
19 / 100
20 ms 416 KB
#include "koala.h"
#include <vector>
std::vector<bool> query(const std::vector<int> &vec)
{
	static int B[105], R[105];
	int n = vec.size();
	for (int i = 0; i < n; i++)
		B[i] = vec[i];
	playRound(B, R);
	std::vector<bool> res(n);
	for (int i = 0; i < n; i++)
		res[i] = R[i] > B[i];
	return res;
}
int minValue(int n, int m)
{
	std::vector<int> vec(n);
	vec[0] = 1;
	auto res = query(vec);
	for (int i = 0; i < n; i++)
	{
		if (!res[i])
			return i;
	}
	throw;
}
int maxValue(int n, int m)
{
	std::vector<bool> in(n, true);
	int cnt = n;
	while (cnt != 1)
	{
		int w = m / cnt;
		std::vector<int> vec(n);
		for (int i = 0; i < n; i++)
			vec[i] = in[i] ? w : 0;
		auto res = query(vec);
		cnt = 0;
		for (int i = 0; i < n; i++)
		{
			in[i] = in[i] & res[i];
			cnt += in[i];
		}
	}
	for (int i = 0; i < n; i++)
	{
		if (in[i])
			return i;
	}
	throw;
}
int greaterValue(int n, int m)
{
	return 0;
}
void allValues(int n, int m, int *res)
{
	if (m == 2 * n)
	{
	}
	else
	{
	}
}
# Verdict Execution time Memory Grader output
1 Correct 7 ms 384 KB Output is correct
2 Correct 9 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 8 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 416 KB Output is correct
2 Correct 14 ms 256 KB Output is correct
3 Correct 16 ms 412 KB Output is correct
4 Correct 13 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -