Submission #232887

#TimeUsernameProblemLanguageResultExecution timeMemory
232887Coroian_DavidArt Class (IOI13_artclass)C++11
0 / 100
131 ms65540 KiB
#include <bits/stdc++.h> #include "artclass.h" using namespace std; int ap[256][256][256]; int n, m; int S; double avg[5]; double avC[3]; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { n = H; m = W; memset(ap, 0, sizeof(ap)); int cul = 0; int s[3]; s[0] = s[1] = s[2] = 0; for(int i = 0; i < n; i ++) { for(int j = 0; j < m; j ++) { if(ap[R[i][j]][G[i][j]][B[i][j]] == 0) cul ++; ap[R[i][j]][G[i][j]][B[i][j]] ++; s[0] += R[i][j]; s[1] += G[i][j]; s[2] += B[i][j]; } } // cout << " CULORU "; for(int i = 0; i <= 2; i ++) { avC[i] += s[i] * 1.0D / (n * m); // cout << s[i] *1.0D / (n * m) << " "; } // cout << " AVG OVERALL " << (s[0] + s[1] + s[2]*1.0D) / (n*m*3.0D); // cout << "\n"; avg[S] += 1.0D * cul / (n * m); //cout << 1.0D*cul/ n / m << "\n"; double x = (s[0] + s[1] + s[2]*1.0D) / (n*m*3.0D); if(x > 150) return 1; if(x > 100) return 3; if(x < 50) return 4; double w = s[0] *1.0D / (n*m); if(w > 150) return 4; return 2; }
#Verdict Execution timeMemoryGrader output
Fetching results...