# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
822097 | alvingogo | Art Class (IOI13_artclass) | C++14 | 60 ms | 6084 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;
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+=(k%2==0?dz:10*dz);
}
int z=max(0,G[i][j]-max(R[i][j],B[i][j]));
gr+=z*z;
}
}
//cout << dif << ' ' << gr << ' ' << dif2 << "\n";
if(dif<100000000){
return 4;
}
else if(dif>2000000000){
return 3;
}
if(gr>5000000){
return 2;
}
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |