Submission #251299

#TimeUsernameProblemLanguageResultExecution timeMemory
251299AaronNaiduArt 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 (float(difference)/200 < h * w * 0.4) { return 4; } if (max(totRed/1000, max(totGreen/1000, totBlue/1000)) - min(totRed/1000, min(totGreen/1000, totBlue/1000)) < float(h) * w / 30) { return 3; } return 2; cout << totGreen/1000 << " " << totRed/1000 << " " << totBlue/1000 << "\n"; cout << numWhite << " " << numBlack << "\n";; cout << float(difference)/(200 * h * w); return 0; }

Compilation message (stderr)

/tmp/ccmkdGwV.o: In function `main':
grader.c:(.text.startup+0x21a): undefined reference to `style'
collect2: error: ld returned 1 exit status