Submission #380804

# Submission time Handle Problem Language Result Execution time Memory
380804 2021-03-23T03:00:51 Z wp1270 Treasure (different grader from official contest) (CEOI13_treasure2) C++14
100 / 100
1 ms 364 KB
#include "treasure.h"

int t[102][102];

void findTreasure(int N) {
	int center = N / 2;

	for (int i = center + 1; i <= N; i++) {
		for (int j = center + 1; j <= N; j++) {
			t[i][j] = countTreasure(1, 1, i, j);
		}
	}
	for (int i = center + 1; i <= N; i++) {
		for (int j = 1; j <= center; j++) {
			t[i][j] = t[i][N] - countTreasure(1, j + 1, i, N);
		}
	}
	for (int i = 1; i <= center; i++) {
		for (int j = center + 1; j <= N; j++) {
			t[i][j] = t[N][j] - countTreasure(i + 1, 1, N, j);
		}
	}
	for (int i = 1; i <= center; i++) {
		for (int j = 1; j <= center; j++) {
			t[i][j] = countTreasure(i + 1, j + 1, N, N) + t[i][N] + t[N][j] - t[N][N];
		}
	}
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			if (t[i][j] > t[i - 1][j] + t[i][j - 1] - t[i - 1][j - 1]) {
				Report(i, j);
			}
		}
	}
}



/*
10
1011010101
1100010001
0100100101
0000101100
1111010100
0010100000
1101010001
0001010100
0101000100
1101010101
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 364 KB Output is correct - N = 5, K = 289, score = 10
2 Correct 1 ms 364 KB Output is correct - N = 10, K = 4475, score = 10
3 Correct 1 ms 364 KB Output is correct - N = 15, K = 22289, score = 10
4 Correct 1 ms 364 KB Output is correct - N = 16, K = 28928, score = 10
5 Correct 0 ms 364 KB Output is correct - N = 55, K = 4005289, score = 10
6 Correct 1 ms 364 KB Output is correct - N = 66, K = 8305803, score = 10
7 Correct 1 ms 364 KB Output is correct - N = 77, K = 15383161, score = 10
8 Correct 1 ms 364 KB Output is correct - N = 88, K = 26244416, score = 10
9 Correct 1 ms 364 KB Output is correct - N = 99, K = 42032201, score = 10
10 Correct 1 ms 364 KB Output is correct - N = 100, K = 43760000, score = 10