| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 155863 | TAISA_ | 미술 수업 (IOI13_artclass) | C++14 | 79 ms | 9052 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "artclass.h"
#include <bits/stdc++.h>
using namespace std;
int r[500][500], g[500][500], b[500][500];
int check(int y, int x) {
int sr = pow(r[y][x + 1] - r[y][x], 2) + pow(r[y + 1][x + 1] - r[y][x], 2) +
pow(r[y + 1][x] - r[y][x], 2) +
pow(r[y + 1][x + 1] - r[y + 1][x], 2);
int sg = pow(g[y][x + 1] - g[y][x], 2) + pow(g[y + 1][x + 1] - g[y][x], 2) +
pow(g[y + 1][x] - g[y][x], 2) +
pow(g[y + 1][x + 1] - g[y + 1][x], 2);
int sb = pow(b[y][x + 1] - b[y][x], 2) + pow(b[y + 1][x + 1] - b[y][x], 2) +
pow(b[y + 1][x] - b[y][x], 2) +
pow(b[y + 1][x + 1] - b[y + 1][x], 2);
return sr + sg + sb;
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
double ave = 0;
int n = 500;
random_device rnd;
mt19937 mt(rnd());
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
r[i][j] = R[i][j];
g[i][j] = G[i][j];
b[i][j] = B[i][j];
}
}
vector<int> v;
for (int k = 0; k < 50; k++) {
int y = mt() % 499, x = mt() % 499;
v.push_back(check(y, x));
}
sort(v.begin(), v.end());
if (v[25] >= 10000) {
return 3;
} else if (v[25] >= 800) {
return 2;
} else {
if (mt() % 2 == 0) {
return 1;
} else {
return 4;
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
