# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
232887 | Coroian_David | Art Class (IOI13_artclass) | C++11 | 131 ms | 65540 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |