# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
716278 | Nonoze | Art Class (IOI13_artclass) | C++14 | 79 ms | 3224 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "artclass.h"
using namespace std;
int differencesI(int n, int R[500][500], int i, int j) {
return ((i<n-1)?abs(R[i][j]-R[i+1][j]):0);
}
int differencesJ(int n, int R[500][500], int i, int j) {
return ((j<n-1)?abs(R[i][j]-R[i][j+1]):0);
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int compR=0, compG=0, compB=0;
double diffR=0, diffG=0, diffB=0;
for (int i = 0; i < H; ++i)
{
for (int j = 0; j < W; ++j)
{
compR+=R[i][j];
diffR+=differencesI(H, R, i, j);
diffR+=differencesJ(W, R, i, j);
compG+=G[i][j];
diffG+=differencesI(H, G, i, j);
diffG+=differencesJ(W, G, i, j);
compB+=B[i][j];
diffB+=differencesI(H, B, i, j);
diffB+=differencesJ(W, B, i, j);
}
}
double moyenneR=(double)compR/(H*W), moyenneG=(double)compG/(H*W), moyenneB=(double)compB/(H*W);
diffR/=H*W, diffG/=H*W, diffB/=H*W;
//cout << moyenneR << " " << moyenneG << " " << moyenneB << endl;
//cout << diffR << " " << diffG << " " << diffB << endl;
if (diffR<=6.0 || diffG<=6.0 || diffB<=6.0)
{
return 4;
}
if (diffR>=37.0 || diffG>=37.0 || diffB>=37.0)
{
return 3;
}
if (moyenneR>=125.0 && moyenneG>=125.0 && moyenneB>=125.0)
{
return 1;
}
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |