제출 #75464

#제출 시각아이디문제언어결과실행 시간메모리
75464Vasiljko보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#include "treasure.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1e9+7; const int N = 105; int a[N][N]; int sum(int i,int j){return a[i][j]-a[i-1][j]-a[i][j-1]+a[i-1][j-1];} void findTreasure(int N){ int m=N/2; for(int i=N;i>=1;i--){ for(int j=N;j>=1;j--){ if(i<=m&&j<=m){ a[i][j]=a[N][j]+a[i][N]-a[N][N]+countTreasure(i,j,N,N); }else if(i<=m&&j>m){ a[i][j]=a[n][j]-countTreasure(i+1,1,N,j); }else if(i>m&&j<=m){ a[i][j]=a[i][n]-countTreasure(1,j+1,i,N); }else{//i>m && j>m a[i][j]=countTreasure(1,1,i,j); } } } for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ if(sum(i,j)==1)Report(i,j); } } }

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

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:21:27: error: 'n' was not declared in this scope
                 a[i][j]=a[n][j]-countTreasure(i+1,1,N,j);
                           ^
treasure.cpp:23:30: error: 'n' was not declared in this scope
                 a[i][j]=a[i][n]-countTreasure(1,j+1,i,N);
                              ^