Submission #42334

#TimeUsernameProblemLanguageResultExecution timeMemory
42334zaqq1414Treasure (different grader from official contest) (CEOI13_treasure2)C++14
0 / 100
2 ms676 KiB
#include "treasure.h" #define MAX 101 int cache[MAX][MAX]; // 각 꼭지점에서 해당 좌표까지 안에 있는 treasure 개수 int size; void dp() { if (size > 1) cache[1][1] = countTreasure(1, 1, size, size) - countTreasure(1, 2, size, size) - countTreasure(2, 1, size, size) + countTreasure(2, 2, size, size); else { cache[1][1] = countTreasure(1, 1, 1, 1); return; } for (int i = 2; i <= size; i++) cache[i][1] = countTreasure(1, 1, i, 1) - cache[i][1]; for (int j = 2; j <= size; j++) cache[1][j] = countTreasure(1, 1, 1, j) - cache[1][j]; for (int i = 2; i <= size; i++) { for (int j = 2; j <= size; j++) { cache[i][j] = countTreasure(1, 1, i, j) - cache[i - 1][j] - cache[i][j - 1] + cache[i][j]; } } } void findTreasure (int N) { // Initialize size = N; dp(); for (int i = 1; i <= size; i++) for (int j = 1; j <= size; j++) if (cache[i][j]) Report(i, j); return; }

Compilation message (stderr)

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)");
                                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...