제출 #575787

#제출 시각아이디문제언어결과실행 시간메모리
575787Mazaalai미술 수업 (IOI13_artclass)C++17
컴파일 에러
0 ms0 KiB
#include "artclass.h" ll r, g, b; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { for (int i = 0; i < 500; i++) for (int j = 0; j < 500; j++) { r += R[i][j]; g += G[i][j]; b += B[i][j]; } if (r > 1.5 * (g + b)) return 2; map <VI, int> cnts; int maxi = 0; for (int j = 0; j < 500; j++) { ll rr, gg, bb; rr = gg = bb = 0; for (int i = 0; i < 500; i++) { rr += R[i][j]; gg += G[i][j]; bb += B[i][j]; } rr /= 5000; gg /= 5000; bb /= 5000; maxi = max(maxi, ++cnts[{rr, gg, bb}]); } if (maxi > 400) return 4; r /= 500 * 500 * 10; g /= 500 * 500 * 10; b /= 500 * 500 * 10; if (r == g && g == b) return 3; return 1; }

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

artclass.cpp:3:1: error: 'll' does not name a type
    3 | ll r, g, b;
      | ^~
artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:7:9: error: 'r' was not declared in this scope
    7 |         r += R[i][j];
      |         ^
artclass.cpp:8:9: error: 'g' was not declared in this scope
    8 |         g += G[i][j];
      |         ^
artclass.cpp:9:9: error: 'b' was not declared in this scope
    9 |         b += B[i][j];
      |         ^
artclass.cpp:11:9: error: 'r' was not declared in this scope
   11 |     if (r > 1.5 * (g + b)) return 2;
      |         ^
artclass.cpp:11:20: error: 'g' was not declared in this scope
   11 |     if (r > 1.5 * (g + b)) return 2;
      |                    ^
artclass.cpp:11:24: error: 'b' was not declared in this scope
   11 |     if (r > 1.5 * (g + b)) return 2;
      |                        ^
artclass.cpp:12:5: error: 'map' was not declared in this scope
   12 |     map <VI, int> cnts;
      |     ^~~
artclass.cpp:12:10: error: 'VI' was not declared in this scope
   12 |     map <VI, int> cnts;
      |          ^~
artclass.cpp:12:14: error: expected primary-expression before 'int'
   12 |     map <VI, int> cnts;
      |              ^~~
artclass.cpp:15:9: error: 'll' was not declared in this scope
   15 |         ll rr, gg, bb; rr = gg = bb = 0;
      |         ^~
artclass.cpp:15:24: error: 'rr' was not declared in this scope
   15 |         ll rr, gg, bb; rr = gg = bb = 0;
      |                        ^~
artclass.cpp:15:29: error: 'gg' was not declared in this scope
   15 |         ll rr, gg, bb; rr = gg = bb = 0;
      |                             ^~
artclass.cpp:15:34: error: 'bb' was not declared in this scope
   15 |         ll rr, gg, bb; rr = gg = bb = 0;
      |                                  ^~
artclass.cpp:24:28: error: 'cnts' was not declared in this scope
   24 |         maxi = max(maxi, ++cnts[{rr, gg, bb}]);
      |                            ^~~~
artclass.cpp:24:16: error: 'max' was not declared in this scope; did you mean 'maxi'?
   24 |         maxi = max(maxi, ++cnts[{rr, gg, bb}]);
      |                ^~~
      |                maxi
artclass.cpp:27:5: error: 'r' was not declared in this scope
   27 |     r /= 500 * 500 * 10;
      |     ^
artclass.cpp:28:5: error: 'g' was not declared in this scope
   28 |     g /= 500 * 500 * 10;
      |     ^
artclass.cpp:29:5: error: 'b' was not declared in this scope
   29 |     b /= 500 * 500 * 10;
      |     ^