제출 #163035

#제출 시각아이디문제언어결과실행 시간메모리
163035rolypolyvg295보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#include "treasure.h" #include <vector> using namespace std; int calculate(int y, int x, vector<vector<int>>&count){ return count[y][x] - count[y+1][x] - count[y][x+1] + count[y+1][x+1]; } void findTreasure (int N) { vector<vector<int>> count(n+2, vector<int>(n+2, 0)); for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++){ count[i][j] = countTreasure(i,j, n, n); } for (int i = 1; i <= n; i++){ for (int j = 1; j <= n; j++) if (calculate(i, j , count) > 0) Report(i, j); } }

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

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:10:28: error: 'n' was not declared in this scope
  vector<vector<int>> count(n+2, vector<int>(n+2, 0));
                            ^