# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61318 | dukati8 | Art Class (IOI13_artclass) | C++14 | 145 ms | 3668 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 <stdio.h>
#include "artclass.h"
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define rep(i,a,b) for(int i=a;i<int(b);i++)
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
//Check sum of all pixels
double totr,totb,totg;
totr=0;totb=0;totg=0;
rep (i,0,H) {
rep (j,0,W) {
totr+=R[i][j];
totb+=B[i][j];
totg+=G[i][j];
}
}
totr/=H*W;
totb/=H*W;
totg/=H*W;
double hi=max(totr,max(totg,totb));
double lo=min(totr,min(totg,totb));
double med=totr+totg+totb-hi-lo;
double diff1=hi-med;
double diff2=med-lo;
//cout << totr << " " << totg << " " << totb<<endl;
if (lo*2.5<hi) return 4;
if (2*totb<totg && 1.3*totb<totr && totg+totr+totb<350) return 2;
if (lo*1.3>hi) return 3;
if (abs(diff1-diff2)<0.7*min(diff1,diff2)) return 3;
if (totg+totr+totb<500) return 1;
//Check for 10*10 square that is relatively white
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |