#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);
// printf("total: %d\n", total);
// 세로
for (int c = N; c > 0; c--) {
if (c == 1) {
for (int i = 1; i <= N; i++) {
// printf("%d %d\n", i, c);
int t = countTreasure(i, c, i, c);
// printf("%d\n", t);
if (t > 0) {
reportlist[index][0] = i; reportlist[index][1] = c;
index++; total--;
if (total == 0) break;
}
}
} else {
int cnt = countTreasure(1, 1, N, c - 1);
// printf("cnt: %d\n", cnt);
int find = total - cnt;
total = total - find;
for (int i = 1; i <= N; i++) {
// printf("%d %d\n", i, c);
int t = countTreasure(i, c, i, c);
// printf("%d\n", t);
if (t > 0) {
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 |
Partially correct |
1 ms |
332 KB |
Output is partially correct - N = 5, K = 605, score = 1 |
2 |
Partially correct |
1 ms |
332 KB |
Output is partially correct - N = 10, K = 9060, score = 1 |
3 |
Partially correct |
0 ms |
332 KB |
Output is partially correct - N = 15, K = 39390, score = 1 |
4 |
Partially correct |
1 ms |
280 KB |
Output is partially correct - N = 16, K = 29118, score = 8 |
5 |
Partially correct |
1 ms |
332 KB |
Output is partially correct - N = 55, K = 9084130, score = 1 |
6 |
Partially correct |
1 ms |
332 KB |
Output is partially correct - N = 66, K = 18863724, score = 1 |
7 |
Partially correct |
1 ms |
416 KB |
Output is partially correct - N = 77, K = 28239904, score = 1 |
8 |
Incorrect |
1 ms |
332 KB |
Output isn't correct - N = 88, K = 60306488, score = 0 |
9 |
Partially correct |
1 ms |
332 KB |
Output is partially correct - N = 99, K = 95628456, score = 1 |
10 |
Partially correct |
1 ms |
332 KB |
Output is partially correct - N = 100, K = 99575100, score = 1 |