# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
8047 | 2014-08-28T03:43:01 Z | gs14004 | Art Class (IOI13_artclass) | C++ | 0 ms | 0 KB |
//#include "artclass.h" #include <cstdlib> #include <cmath> int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { double delta = 0; for (int i=0; i<H; i++) { for (int j=0; j<W-1; j++) { delta += sqrt(abs(R[i][j+1] - R[i][j]) + abs(G[i][j+1] - G[i][j]) + abs(B[i][j+1] - B[i][j])); } } for (int j=0; j<W; j++) { for (int i=0; i<H-1; i++) { delta += sqrt(abs(R[i][j] - R[i+1][j]) + abs(G[i][j] - G[i+1][j]) + abs(B[i][j] - B[i+1][j])); } } double t = 100.0 * delta / (2 * W * H - H - W); if(t < 250) return 4; else if(t < 450) return 1; else if(t < 675) return 2; return 3; }