Submission #125741

#TimeUsernameProblemLanguageResultExecution timeMemory
125741MoNsTeR_CuBeArt Class (IOI13_artclass)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "artclass.h" using namespace std; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { double r = 0, g = 0, b = 0; double totG = 0; double totR = 0; double totB = 0; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ totG += G[i][j]; totR += R[i][j]; totB += B[i][j]; if(j + 1 < W){ r += abs(R[i][j] - R[i][j+1]); g += abs(G[i][j] - G[i][j+1]); b += abs(B[i][j] - B[i][j+1]); } if(i + 1 < H){ r += abs(R[i][j] - R[i+1][j]); g += abs(G[i][j] - G[i+1][j]); b += abs(B[i][j] - B[i+1][j]); } } } //cout << r/((double)(H*W)) << ' ' << g/((double)(H*W)) << ' ' << b/((double)(H*W)) << endl; if(r/((double)(H*W)) < (double)(6.22) || g/((double)(H*W)) < (double)(6) || b/((double)(H*W)) < (double)(6.1)){ return 4; } if(r/((double)(H*W)) > (double)(36.8) || g/((double)(H*W)) > (double)(36.3) || b/((double)(H*W)) > (double)(35.3)){ return 3; } if(totR/((double)(H*W)) > (double)(130.0) && totG/((double)(H*W)) > (double)(130.0) && totB/((double)(H*W) > (double)(130.0))){ return 1; } return 2; //cout << totR/((double)(H*W)) << ' ' << totG/((double)(H*W)) << ' ' << totB/((double)(H*W)) << endl; } signed main(){ ios::sync_with_stdio(false); cin.tie(0); int R[500][500], G[500][500], B[500][500]; int H, W; cin >> H >> W; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ cin >> R[i][j] >> G[i][j] >> B[i][j]; } } cout << style(H,W,R,G,B) << endl; }

Compilation message (stderr)

/tmp/ccGwUeRx.o: In function `main':
artclass.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccACmJsa.o:grader.c:(.text.startup+0x0): first defined here
/tmp/ccACmJsa.o: In function `main':
grader.c:(.text.startup+0x21a): undefined reference to `style'
collect2: error: ld returned 1 exit status