#include <bits/stdc++.h>
#include "treasure.h"
using namespace std;
const int maxn = 110;
int acc[maxn][maxn];
bool mat[maxn][maxn];
void findTreasure(int n) {
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
if (i <= n/2 && j <= n/2) acc[i][j] = countTreasure(1, 1, i, n) - acc[i][j-1];
else if (i <= n/2) acc[i][j] = countTreasure(1, 1, i, j);
else if (j <= n/2) acc[i][j] = countTreasure(1, 1, i, j);
else acc[i][j] = countTreasure(1, 1, i, j);
}
}
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
mat[i][j] = acc[i][j] - acc[i-1][j] - acc[i][j-1] + acc[i-1][j-1];
}
}
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j) {
if (mat[i][j]) Report(i, j);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 2, c = 1 |
2 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 6 |
3 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 1 |
4 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 1 |
5 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 3 |
6 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 1 |
7 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 1 |
8 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 8, c = 20 |
9 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 2 |
10 |
Incorrect |
1 ms |
384 KB |
Error - no treasure at (r, c) : r = 1, c = 3 |