# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61252 | istlemin | Art Class (IOI13_artclass) | C++14 | 140 ms | 9452 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;
#define rep(i,a,b) for(int i = a; i<int(b);++i)
#define all(v) v.begin(),v.end()
#define sz(v) v.size()
#define trav(a,c) for(auto a: c)
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pii;
ll h,w;
vector<vi> r,g,b;
ll sumDiff(ll dh,ll dw){
ll sum = 0;
rep(i,0,h){
rep(j,0,w){
if(i+dh<h){
sum += abs(r[i][j]-r[i+dh][j]);
sum += abs(g[i][j]-g[i+dh][j]);
sum += abs(b[i][j]-b[i+dh][j]);
}
if(j+dw<w){
sum += abs(r[i][j]-r[i][j+dw]);
sum += abs(g[i][j]-g[i][j+dw]);
sum += abs(b[i][j]-b[i][j+dw]);
}
}
}
return sum;
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
h = H; w = W;
r.resize(h,vi(w));
g.resize(h,vi(w));
b.resize(h,vi(w));
rep(i,0,h) rep(j,0,w){
r[i][j] = R[i][j];
g[i][j] = G[i][j];
b[i][j] = B[i][j];
}
ll sumD = sumDiff(5,5);
if(sumD<12000000LL) return 4;
if(sumD<40000000LL) return 1;
return 3;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |