Submission #40816

#TimeUsernameProblemLanguageResultExecution timeMemory
40816meyladyTreasure (different grader from official contest) (CEOI13_treasure2)C++14
0 / 100
2 ms748 KiB
#include "treasure.h" #include <stdio.h> int sum[104][104]; int Map[104][104]; void findTreasure (int N) { int cnt = countTreasure(1, 1, N, N); int k = 1; for (int i = 1; i <= N; i++) { int partial; if (i < N) { int par1 = countTreasure(i + 1, k, N, N); for (int j = 1; j <= N; j++) { if (j < N)partial = par1 + countTreasure(k, j + 1, N, N) - countTreasure(i + 1, j + 1, N, N); else partial = par1; sum[i][j] = cnt - partial; } } else { for (int j = 1; j < N; j++) { partial = countTreasure(k, j+1, N, N); sum[i][j] = cnt - partial; } } } sum[N][N] = cnt; for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { Map[i][j] = sum[i][j] - sum[i - 1][j] - sum[i][j - 1] + sum[i - 1][j - 1]; } } for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { if (Map[i][j] == 1)Report(i, j); } } }

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...