# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
251287 | AaronNaidu | 미술 수업 (IOI13_artclass) | C++14 | 134 ms | 6136 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "artclass.h"
using namespace std;
typedef long long ll;
int R[500][500], B[500][500], G[500][500];
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
ll totGreen = 0;
ll totRed = 0;
ll totBlue = 0;
ll numWhite = 0;
ll numBlack = 0;
ll difference = 0;
for (int i = 0; i < 500; i++)
{
for (int j = 0; j < 500; j++)
{
totGreen += g[i][j];
totBlue += b[i][j];
totRed += r[i][j];
if (r[i][j] < 50 and b[i][j] < 50 and g[i][j] < 50)
{
numWhite++;
}
if (r[i][j] > 220 and b[i][j] > 220 and g[i][j] > 220)
{
numBlack++;
}
if (i > 0 and j > 0 and i < 499 and j < 499)
{
difference += abs(r[i][j] - r[i-1][j]) + abs(r[i][j] - r[i+1][j]) + abs(r[i][j] - r[i][j+1]) + abs(r[i][j] - r[i][j-1]);
difference += abs(g[i][j] - g[i-1][j]) + abs(g[i][j] - g[i+1][j]) + abs(g[i][j] - g[i][j+1]) + abs(g[i][j] - g[i][j-1]);
difference += abs(b[i][j] - b[i-1][j]) + abs(b[i][j] - b[i+1][j]) + abs(b[i][j] - b[i][j+1]) + abs(b[i][j] - b[i][j-1]);
}
}
}
if (numBlack > 35000)
{
return 1;
}
if (difference/1000 < 10000)
{
return 4;
}
if (max(totRed/1000, max(totGreen/1000, totBlue/1000)) - min(totRed/1000, min(totGreen/1000, totBlue/1000)) < 6000)
{
return 3;
}
return 2;
cout << totGreen/1000 << " " << totRed/1000 << " " << totBlue/1000 << "\n";
cout << numWhite << " " << numBlack << "\n";;
cout << difference/1000;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |