제출 #43819

#제출 시각아이디문제언어결과실행 시간메모리
43819PowerOfNinjaGo미술 수업 (IOI13_artclass)C++14
컴파일 에러
0 ms0 KiB
//Power Of Ninja Go #include <bits/stdc++.h> #ifdef atom #include "gradertxt.c" #else #include "artclass.h" #endif using namespace std; typedef long long ll; typedef pair<int, int> ii; #define X first #define Y second #define vi vector<int> #define vii vector< ii > #define pb push_back int sq(int x){ return x*x;} int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { double res = 0; int n = DIM[0], m = DIM[1]; for(int i = 0; i< n; i++) { for(int j = 0; j< m; j++) { if(i+1< n) res += sq(R[i][j]-R[i+1][j])+sq(G[i][j]-G[i+1][j])+sq(B[i][j]-B[i+1][j]); if(j+1< m) res += sq(R[i][j]-R[i][j+1])+sq(G[i][j]-G[i][j+1])+sq(B[i][j]-B[i][j+1]); } } res /= n; res /= m; if(res> 5000) return 3; if(res> 1200) return 1; if(res> 500) return 2; return 4; }

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

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:19:13: error: 'DIM' was not declared in this scope
     int n = DIM[0], m = DIM[1];
             ^~~
artclass.cpp:19:13: note: suggested alternative: 'EDOM'
     int n = DIM[0], m = DIM[1];
             ^~~
             EDOM
artclass.cpp:22:27: error: 'm' was not declared in this scope
         for(int j = 0; j< m; j++)
                           ^
artclass.cpp:28:22: error: 'm' was not declared in this scope
     res /= n; res /= m;
                      ^