제출 #39437

#제출 시각아이디문제언어결과실행 시간메모리
39437smu201111192보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#include "treasure.h"
#include <cstdio>
#include <iostream>
int dp[105][105];
int chk[105][105];
int g(int y1,int x1,int y2,int x2){
    return dp[y2][x2] - dp[y1-1][x2] - dp[y2][x1-1] + dp[y1-1][x1-1];
}
void findTreasure (int N) {
    if(cnt > 0) Report (1, 1);
    if(N <= 5){
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                int cnt = countTreasure(i, j, i, j);
                if(cnt)Report(i,j);
            }
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            int cnt = countTreasure(1,1,i,j);
            dp[i][j] = cnt;
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(g(i,j,i,j)){
                Report(1,1);
            }
        }
    }
}

컴파일 시 표준 에러 (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)");
                                  ^
treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:10:8: error: 'cnt' was not declared in this scope
     if(cnt > 0) Report (1, 1);
        ^
treasure.cpp:12:24: error: 'n' was not declared in this scope
         for(int i=1;i<=n;i++){
                        ^
treasure.cpp:19:20: error: 'n' was not declared in this scope
     for(int i=1;i<=n;i++){
                    ^
treasure.cpp:25:20: error: 'n' was not declared in this scope
     for(int i=1;i<=n;i++){
                    ^