답안 #999301

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
999301 2024-06-15T09:37:00 Z MilosMilutinovic 보물 찾기 (CEOI13_treasure2) C++14
0 / 100
1 ms 600 KB
#include "treasure.h"
#include <bits/stdc++.h>
 
using namespace std;

const int MAX = 111;

int val[MAX][MAX];
 
void findTreasure(int N) {
  int total = countTreasure(1, 1, N, N);
  int mid = N / 2;
  for (int i = N; i >= 1; i--) {
    for (int j = N; j >= 1; j--) {
      if (i >= mid && j >= mid) {
        val[i][j] = countTreasure(1, i, 1, j);
      } else if (i >= mid && j < mid) {
        val[i][j] = val[i][N] - countTreasure(1, j + 1, i, N);
      } else if (i < mid && j >= mid) {
        val[i][j] = val[N][j] - countTreasure(i + 1, 1, N, j);
      } else {
        val[i][j] = -(total - val[i][N] - val[N][j] - countTreasure(i + 1, j + 1, N, N));
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      int c = val[i][j] - val[i - 1][j] - val[i][j - 1] + val[i - 1][j - 1];
      if (c == 1) {
        Report(i, j);
      }
    }
  }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 5, r2 = 1, c2 = 4
2 Incorrect 0 ms 344 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 10, r2 = 1, c2 = 9
3 Incorrect 0 ms 344 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 15, r2 = 1, c2 = 14
4 Incorrect 0 ms 348 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 16, r2 = 1, c2 = 15
5 Incorrect 0 ms 344 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 55, r2 = 1, c2 = 54
6 Incorrect 0 ms 348 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 66, r2 = 1, c2 = 65
7 Incorrect 0 ms 348 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 77, r2 = 1, c2 = 76
8 Incorrect 1 ms 600 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 88, r2 = 1, c2 = 87
9 Incorrect 1 ms 348 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 99, r2 = 1, c2 = 98
10 Incorrect 0 ms 348 KB Error - check the range of the parameters of countTreasure() : r1 = 1, c1 = 100, r2 = 1, c2 = 99