# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1012592 | parsadox2 | Art Class (IOI13_artclass) | C++17 | 202 ms | 6276 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 sr[500][500] , sg[500][500] , sb[500][500];
int style(int h , int w , int R[500][500] , int G[500][500] , int B[500][500])
{
srand(time(NULL));
int sum = 0 , all = 0 , eq = 0;
for(int i = 0 ; i < w ; i++) for(int j = 0 ; j < h ; j++) for(int ii = max(i - 10 , 0) ; ii <= i ; ii++)
{
for(int jj = max(j - 10 , 0) ; jj <= min(h - 1 , j + 10) ; jj++)
{
int tmp = 0;
tmp = max({abs(R[i][j] - R[ii][jj]) , abs(G[i][j] - G[ii][jj]) , abs(B[i][j] - B[ii][jj])});
if(tmp <= 10)
eq++;
}
}
for(int i = 0 ; i < w ; i++) for(int j = 0 ; j < h ; j++)
{
all++;
int r = R[i][j] , g = G[i][j] , b = B[i][j];
if(g + 15 > r && g + 15 > b)
sum++;
}
//cout << eq << " " << sum << " " << all << endl;
long double t1 = 1.0 * eq / all;
long double t2 = 1.0 * sum / all;
//cout << setprecision(6) << fixed << t1 << " " << t2 << endl;
all += all/5;
vector <int> vec = {3 , 4};
if(t1 > 90)
{
if(t2 > 0.5)
return 1;
else
return 4;
}
if(t1 < 25)
return 3;
if(t2 > 0.8)
return 2;
return rand() % 2 + 1;
}
/*signed main()
{
freopen("sample2-05" , "r" , stdin);
int h , w;
cin >> h >> w;
for(int i = 0 ; i < w ; i++) for(int j = 0 ; j < h ; j++)
{
cin >> sr[i][j] >> sg[i][j] >> sb[i][j];
}
cout << style(h , w , sr , sg , sb) << endl;
return 0;
}*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |