Submission #251296

#TimeUsernameProblemLanguageResultExecution timeMemory
251296AaronNaiduArt Class (IOI13_artclass)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "artclass.h" using namespace std; typedef long long ll; int R[500][500], B[500][500], G[500][500]; int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) { ll totGreen = 0; ll totRed = 0; ll totBlue = 0; ll numWhite = 0; ll numBlack = 0; ll difference = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { totGreen += g[i][j]; totBlue += b[i][j]; totRed += r[i][j]; if (r[i][j] < 50 and b[i][j] < 50 and g[i][j] < 50) { numWhite++; } if (r[i][j] > 220 and b[i][j] > 220 and g[i][j] > 220) { numBlack++; } if (i > 0 and j > 0 and i < 499 and j < 499) { difference += abs(r[i][j] - r[i-1][j]) + abs(r[i][j] - r[i+1][j]) + abs(r[i][j] - r[i][j+1]) + abs(r[i][j] - r[i][j-1]); difference += abs(g[i][j] - g[i-1][j]) + abs(g[i][j] - g[i+1][j]) + abs(g[i][j] - g[i][j+1]) + abs(g[i][j] - g[i][j-1]); difference += abs(b[i][j] - b[i-1][j]) + abs(b[i][j] - b[i+1][j]) + abs(b[i][j] - b[i][j+1]) + abs(b[i][j] - b[i][j-1]); } } } if (numBlack > 35000) { return 1; } if (difference/200 < h * w) { return 4; } if (max(totRed/1000, max(totGreen/1000, totBlue/1000)) - min(totRed/1000, min(totGreen/1000, totBlue/1000)) < r * w / 30) { return 3; } return 2; cout << totGreen/1000 << " " << totRed/1000 << " " << totBlue/1000 << "\n"; cout << numWhite << " " << numBlack << "\n";; cout << difference/1000; return 0; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:47:117: error: invalid operands of types 'int (*)[500]' and 'int' to binary 'operator*'
     if (max(totRed/1000, max(totGreen/1000, totBlue/1000)) - min(totRed/1000, min(totGreen/1000, totBlue/1000)) < r * w / 30)
                                                                                                                   ~~^~~