Submission #966156

# Submission time Handle Problem Language Result Execution time Memory
966156 2024-04-19T12:53:52 Z 42kangaroo Prisoner Challenge (IOI22_prison) C++17
0 / 100
0 ms 348 KB
#include "prison.h"

#include <vector>

std::vector<std::vector<int>> devise_strategy(int N) {
	using namespace std;
	vector<vector<int>> strat(27, vector<int>(N + 1, 0));
	strat[0][0] = 0;
	for (int i = 0; i < N; ++i) {
		strat[0][i + 1] = ((i + 1) >> 11) + 1;
	}
	strat[1][0] = strat[2][0] = strat[3][0] = 1;
	for (int i = 1; i < 4; ++i) {
		for (int j = 0; j < N; ++j) {
			if ((j + 1) >> 11 == i - 1) {
				strat[i][j + 1] = 4 + (((j + 1) >> 10) % 2);
			} else if ((j + 1) >> 11 > i - 1) strat[i][j + 1] = -2;
			else strat[i][j + 1] = -1;
		}
	}
	for (int i = 0 ; i < 11; ++i) {
		strat[5+ 2*i][0] = strat[6 + 2*i][0] = i % 2;
		for (int j = 0; j < N; ++j) {
			if (((j + 1) >> (11 - i)) % 2 == 0) {
				strat[6 + 2*i][j + 1] = -1 - (i)%2;
				strat[5 + 2*i][j + 1] = 7 + 2*i + ((j + 1) >> (10 - i)) % 2;
			} else {
				strat[5 + 2*i][j + 1] = -1 - (i + 1)%2;
				strat[6 + 2*i][j + 1] = 7 + 2*i + ((j + 1) >> (10 - i)) % 2;
			}
		}
	}
	return strat;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -