# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61392 | Flugan42 | Art Class (IOI13_artclass) | C++14 | 113 ms | 3708 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>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef long double lld;
#define inf 9000000000000000000
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define per(i,a,b) for(ll i = a; i >= b; i--)
#define trav(a,x) for(auto a : x)
#define sz(x) (ll)(x).size()
#define all(x) x.begin(),x.end()
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
ll r=0,g=0,b=0;
int d=0,s=0,cnt=0,cw=0,cb=0;
for(int i = 0; i < H; i+=20) for(int j = 0; j < W; j+=20){
for(int k = 0; k < H; k+=20) for(int l = 0; l < W; l+=20){
d = max(d,abs(R[i][j]-R[k][l])+abs(G[i][j]-G[k][l])+abs(B[i][j]-B[k][l]));
s += abs(R[i][j]-R[k][l])+abs(G[i][j]-G[k][l])+abs(B[i][j]-B[k][l]);
cnt++;
}
}
rep(i,0,H) rep(j,0,W){
if (R[i][j]+G[i][j]+B[i][j] <= 150) cw++;
if (R[i][j]+G[i][j]+B[i][j] >= 740) cb++;
}
s /= cnt;
rep(i,0,H) rep(j,0,W) r += R[i][j];
rep(i,0,H) rep(j,0,W) g += G[i][j];
rep(i,0,H) rep(j,0,W) b += B[i][j];
//cout << cw << " " << cb << endl;
//cout << (r+g+b)/(W*H) << " " << r/(W*H) << " " << g/(W*H) << " " << b/(W*H) << " " << d << " " << s << endl;
if ((r+g+b)/(W*H) >= 450 || (cb >= 10000 && cw >= 50)) return 1;
if (b/(W*H) >= 70 && cb >= 15) return 3;
if (d >= 500) return 2;
return 4;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |