# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
471080 | chointae | 보물 찾기 (CEOI13_treasure2) | C++17 | 1 ms | 416 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
---|---|---|---|---|
Fetching results... |