답안 #102394

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
102394 2019-03-24T16:01:44 Z Milki 보물 찾기 (CEOI13_treasure2) C++14
0 / 100
3 ms 512 KB
#include<bits/stdc++.h>
#include <treasure.h>
using namespace std;

#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define REP(i, n) FOR(i, 0, n)
#define _ << " " <<
#define sz(x) ((int) x.size())
#define pb(x) push_back(x)
#define TRACE(x) cerr << #x << " = " << x << endl

typedef long long ll;
typedef pair<ll, ll> point;

const int MAXN = 105;

int pref[MAXN][MAXN];
int sum;

void findTreasure(int n){
  int mid = (n + 1) / 2;
  for(int i = n; i > 0; --i) for(int j = n; j > 0; --j) {
    if(i >= mid && j >= mid) pref[i][j] = countTreasure(1, 1, i, j);
    else if(i >= mid && j <= mid) pref[i][j] = pref[i][n] - countTreasure(1, j + 1, i, n);
    else if(i <= mid && j >= mid) pref[i][j] = pref[n][j] - countTreasure(i + 1, 1, n, j);
    else pref[i][j] = pref[n][n] - countTreasure(i + 1, j + 1, n, n) - pref[i][n] - pref[n][j];
  }

  FOR(i, 1, n + 1) FOR(j, 1, n + 1)
    if(pref[i][j] - pref[i - 1][j] - pref[i][j - 1] + pref[i - 1][j - 1]) Report(i, j);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Error - no treasure at (r, c) : r = 2, c = 3
2 Incorrect 2 ms 384 KB Error - no treasure at (r, c) : r = 3, c = 5
3 Incorrect 2 ms 384 KB Error - no treasure at (r, c) : r = 3, c = 8
4 Incorrect 3 ms 384 KB Error - no treasure at (r, c) : r = 2, c = 8
5 Incorrect 2 ms 256 KB Error - no treasure at (r, c) : r = 4, c = 28
6 Incorrect 3 ms 384 KB Error - no treasure at (r, c) : r = 1, c = 33
7 Incorrect 2 ms 384 KB Error - no treasure at (r, c) : r = 1, c = 39
8 Incorrect 3 ms 512 KB Error - no treasure at (r, c) : r = 8, c = 44
9 Incorrect 2 ms 384 KB Error - no treasure at (r, c) : r = 1, c = 50
10 Incorrect 2 ms 512 KB Error - no treasure at (r, c) : r = 1, c = 50