# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
822168 | alvingogo | Art Class (IOI13_artclass) | C++14 | 70 ms | 3808 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 "artclass.h"
#include <bits/stdc++.h>
using namespace std;
int style(int h, int w, int R[500][500], int G[500][500], int B[500][500]) {
long long dif=0,gr=0,dif2=0,gr2=0;
const int dx[4]={1,1,1,0},dy[4]={1,0,-1,1};
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
for(int k=0;k<4;k++){
int a=i+dx[k],b=j+dy[k];
if(a>=h || b>=w || a<0 || b<0){
continue;
}
int dz=(R[i][j]-R[a][b])*(R[i][j]-R[a][b])+(G[i][j]-G[a][b])*(G[i][j]-G[a][b])+(B[i][j]-B[a][b])*(B[i][j]-B[a][b]);
dif+=dz;
dif2+=(dz<=500);
}
int z=max(0,G[i][j]-max(R[i][j],B[i][j]));
gr+=1ll*z*z*z;
gr2+=1ll*z*z;
}
}
//cout << dif << ' ' << gr << ' ' << dif2 << " " << gr2 << "\n";
if(dif<100000000){
return 4;
}
else if(dif>2000000000){
return 3;
}
if(gr2>5000000 || dif2<700000){
return 2;
}
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |