Submission #232891

#TimeUsernameProblemLanguageResultExecution timeMemory
232891Coroian_DavidArt Class (IOI13_artclass)C++11
47 / 100
91 ms22648 KiB
#include <bits/stdc++.h> #include "artclass.h" using namespace std; bool 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]] = 1; 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); double c = 100.0D * cul / (n * m); // cout << " FOR THIS IS " << x << " CUL UNMBER " << c << "\n"; if(x > 150) return 1; if(c > 25 && c < 55 && x > 60 && x < 105) return 2; if(x < 50) return 4; double w = s[0] *1.0D / (n*m); if(c < 25) return 4; return 3; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:71:12: warning: unused variable 'w' [-Wunused-variable]
     double w = s[0] *1.0D / (n*m);
            ^
#Verdict Execution timeMemoryGrader output
Fetching results...