# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
232891 | Coroian_David | Art Class (IOI13_artclass) | C++11 | 91 ms | 22648 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;
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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |