# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
130108 | colorxxx | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 2 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "treasure.h"
int map[105][105];
void check(int r, int c, int N)
{
int m = N / 2;
if (r > m && c > m) map[r][c] = countTreasure(1, 1, r, c);
if (r > m && c <= m)map[r][c] = map[r][N] - countTreasure(1, c + 1, r, N);
if (r <= m && c > m) map[r][c] = map[N][c] - countTreasure(r + 1, 1, N, c);
if (r <= m && c <= m) map[r][c] = map[r][N] + map[N][c] + countTreasure(r + 1, c + 1, N, N) - map[N][N];
}
void findTreasure(int N) {
for (int i = N; i ; i--) {
for (int j = N; j ; j--) {
check(i, j, N);
}
}
for (int i = N; i ; i--) {
for (int j = N; j ; j--) {
if (map[i][j] - map[i - 1][j] - map[i][j - 1] + map[i - 1][j - 1])Report(i, j);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |