# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
396938 | definitelynotmee | Art Class (IOI13_artclass) | C++98 | 74 ms | 3484 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 <bits/stdc++.h>
#include "artclass.h"
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INFL = (1LL<<62)-1;
const int INF = (1<<30)-1;
const int MAXN = 500;
//int R[500][500], G[500][500], B[500][500];
//int N, M;
int dx[]{1,0,-1,0};
int dy[]{0,1,0,-1};
int style(int n, int m, int r[500][500], int g[500][500], int b[500][500]){
//N = n, M = m;
ll medr =0, medg = 0, medb = 0;
ll score[4] {0,0,0,0};
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
const int cr = r[j][i];
const int cg = g[j][i];
const int cb = b[j][i];
medr+=cr;
medg+=cg;
medb+=cb;
for(int k = 0; k < 4; k++){
int xi = j + dx[k];
int yi = i + dy[k];
if(xi < 0 || yi < 0 || xi >= m || yi >= n)
continue;
score[2]+= (cr-r[xi][yi])*(cr-r[xi][yi]) + (cg-g[xi][yi])*(cg-g[xi][yi]) + (cb-b[xi][yi])*(cb-b[xi][yi]);
}
//if((r[j][i] <= 55 && g[j][i] <= 55 && b[j][i] <= 55) ||(r[j][i] >= 200 && g[j][i] >= 200 && b[j][i] >= 200))
// score[2]++;
}
}
medr/=n*m;
medg/=n*m;
medb/=n*m;
score[0] = (medr-255) + abs(medg-255) + abs(medb-255);
score[1] = medr + abs(medg-125) + medb;
score[2]/= n*m;
//cout << score[0] << ' ' << score[1] << ' ' << score[2] << ' ' << green << '\n';
if(score[2] >= 8500)
return 3;
if(score[2] <= 1000)
return 4;
if(score[1] <= 240)
return 2;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |