답안 #40778

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
40778 2018-02-08T06:53:07 Z bysu 보물 찾기 (CEOI13_treasure2) C++14
48 / 100
2 ms 676 KB
#include "treasure.h"
int dp[101][101];
int func(int r, int c) {
	if (dp[r][c] == -1) {
		dp[r][c] = countTreasure(1,1,r,c);
		if (dp[r][c] == 0) {
			for (int i = 1; i <= r; i++) {
				for (int j = 1; j <= c; j++) {
					dp[i][j] = 0;
				}
			}
		}
	}
	return dp[r][c];
}
void findTreasure (int N) {
	for (int i = 1; i < 101; i++) {
		for (int j = 1; j < 101; j++) {
			dp[i][j] = -1;
		}
	}
	for (int i = N; i > 0; i--) {
		for (int j = N; j > 0; j--) {
			func(i, j);
		}
	}
	for (int i = N; i > 0; i--) {
		for (int j = N; j > 0; j--) {
			if (dp[i][j] - dp[i - 1][j] - dp[i][j - 1] + dp[i - 1][j - 1]) {
				Report(i, j);
			}
		}
	}
}

Compilation message

grader.c: In function 'int main()':
grader.c:63:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         my_assert(strlen(A[i]+1) == N, "each line of the map must contain N zeroes or ones (before loop)");
                                  ^
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 376 KB Output is partially correct - N = 5, K = 425, score = 8
2 Partially correct 1 ms 376 KB Output is partially correct - N = 10, K = 7075, score = 4
3 Partially correct 1 ms 448 KB Output is partially correct - N = 15, K = 34890, score = 4
4 Partially correct 1 ms 448 KB Output is partially correct - N = 16, K = 35985, score = 8
5 Partially correct 2 ms 476 KB Output is partially correct - N = 55, K = 6782050, score = 4
6 Partially correct 1 ms 536 KB Output is partially correct - N = 66, K = 14086215, score = 4
7 Partially correct 1 ms 536 KB Output is partially correct - N = 77, K = 25651732, score = 4
8 Partially correct 1 ms 536 KB Output is partially correct - N = 88, K = 44642224, score = 4
9 Partially correct 2 ms 536 KB Output is partially correct - N = 99, K = 71566902, score = 4
10 Partially correct 2 ms 676 KB Output is partially correct - N = 100, K = 74507500, score = 4