제출 #86163

#제출 시각아이디문제언어결과실행 시간메모리
86163faceless보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#include "treasure.h" bool c[120][120]; int dp[120][120]; int find (int idx, int L, int R, int cnt = -1) { if (cnt == -1) { cnt = findTreasure (1, idx, L, R - 1) - dp[idx - 1][R - 1] + dp[idx - 1][L - 1]; } if (cnt == (R - L)) { for (int j = L; j < R: j++) { c[i][j] = 1; } return cnt; } if (cnt == 0) return cnt; int mid = (L + R) >> 1; int x = find (idx, mid, R); find (idx, L, mid, cnt - x); return cnt; } void findTreasure (int N) { for (int i = 1; i <= N; i++) { find (i, 1, N + 1); for (int j = 1; j <= N; j++) { dp[i][j] = dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1]; } } for (int i = 1; i <= N; i++) for (int j = 1; j <= N; j++) if (c[i][j]) Report (i, j); }

컴파일 시 표준 에러 (stderr) 메시지

treasure.cpp: In function 'int find(int, int, int, int)':
treasure.cpp:7:9: error: 'findTreasure' was not declared in this scope
   cnt = findTreasure (1, idx, L, R - 1) - dp[idx - 1][R - 1] + dp[idx - 1][L - 1];
         ^~~~~~~~~~~~
treasure.cpp:7:9: note: suggested alternative: 'countTreasure'
   cnt = findTreasure (1, idx, L, R - 1) - dp[idx - 1][R - 1] + dp[idx - 1][L - 1];
         ^~~~~~~~~~~~
         countTreasure
treasure.cpp:10:24: error: found ':' in nested-name-specifier, expected '::'
   for (int j = L; j < R: j++) {
                        ^
treasure.cpp:10:23: error: 'R' is not a class, namespace, or enumeration
   for (int j = L; j < R: j++) {
                       ^
treasure.cpp:10:29: error: expected ';' before ')' token
   for (int j = L; j < R: j++) {
                             ^
treasure.cpp:11:6: error: 'i' was not declared in this scope
    c[i][j] = 1;
      ^