#include "treasure.h"
void findTreasure (int N) {
int MAXN = 101;
int reportlist[MAXN * MAXN][2];
int index = 0;
int total = countTreasure(1, 1, N, N);
// 세로
for (int c = N - 1; c > 0; c--) {
int cnt = countTreasure(1, 1, N, c);
int find = total - cnt;
total = total - find;
for (int i = 1; i <= N; i++) {
if (countTreasure(1, 1, i, c)) {
reportlist[index][0] = i; reportlist[index][1] = c;
index++; find--;
if (find == 0) break;
}
}
if (total == 0) break;
}
for (int i = 0; i < index; i++) Report(reportlist[i][0], reportlist[i][1]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Error - no treasure at (r, c) : r = 2, c = 3 |
2 |
Incorrect |
1 ms |
332 KB |
Error - no treasure at (r, c) : r = 2, c = 9 |
3 |
Incorrect |
0 ms |
332 KB |
Error - no treasure at (r, c) : r = 1, c = 14 |
4 |
Incorrect |
0 ms |
332 KB |
Error - no treasure at (r, c) : r = 2, c = 12 |
5 |
Incorrect |
1 ms |
332 KB |
Error - no treasure at (r, c) : r = 1, c = 54 |
6 |
Incorrect |
1 ms |
412 KB |
Error - no treasure at (r, c) : r = 1, c = 65 |
7 |
Incorrect |
1 ms |
332 KB |
Error - no treasure at (r, c) : r = 1, c = 76 |
8 |
Incorrect |
1 ms |
408 KB |
Error - no treasure at (r, c) : r = 1, c = 87 |
9 |
Incorrect |
1 ms |
332 KB |
Error - no treasure at (r, c) : r = 2, c = 98 |
10 |
Incorrect |
1 ms |
332 KB |
Error - no treasure at (r, c) : r = 1, c = 99 |