#include "treasure.h"
int t[102][102];
void findTreasure(int N) {
int center = N / 2;
for (int i = center; i <= N; i++) {
for (int j = center; j <= N; j++) {
t[i][j] = countTreasure(1, 1, i, j);
}
}
for (int i = center; 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; 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] = t[N][j] + t[i][N] + countTreasure(i + 1, j + 1, N, N) - 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 |
Partially correct |
1 ms |
364 KB |
Output is partially correct - N = 5, K = 326, score = 8 |
2 |
Correct |
1 ms |
364 KB |
Output is correct - N = 10, K = 4475, score = 10 |
3 |
Partially correct |
1 ms |
364 KB |
Output is partially correct - N = 15, K = 22626, score = 8 |
4 |
Correct |
1 ms |
364 KB |
Output is correct - N = 16, K = 28928, score = 10 |
5 |
Partially correct |
1 ms |
512 KB |
Output is partially correct - N = 55, K = 4009826, score = 8 |
6 |
Correct |
1 ms |
364 KB |
Output is correct - N = 66, K = 8305803, score = 10 |
7 |
Partially correct |
1 ms |
384 KB |
Output is partially correct - N = 77, K = 15392054, score = 8 |
8 |
Correct |
1 ms |
364 KB |
Output is correct - N = 88, K = 26244416, score = 10 |
9 |
Partially correct |
1 ms |
364 KB |
Output is partially correct - N = 99, K = 42046902, score = 8 |
10 |
Correct |
1 ms |
364 KB |
Output is correct - N = 100, K = 43760000, score = 10 |