# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
283270 | kevlee | 미술 수업 (IOI13_artclass) | C++17 | 77 ms | 6204 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "artclass.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mod 1000000007
#define h1 7897897897897897
#define h2 7897466719774591
#define b1 98762051
#define b2 98765431
#define inf 1000000000
#define pi 3.1415926535897932384626
#define LMAX 9223372036854775807
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pii>
#define SET(a, b) memset(a, b, sizeof(a));
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
ll sum = 0, cnt = 0;
FOR(i, 0, h-1) {
FOR(j, 0, w-1) {
if (j > 0) {
cnt++;
sum += abs(r[i][j] - r[i][j-1]) + abs(g[i][j] - g[i][j-1]) + abs(b[i][j] - b[i][j-1]);
}
if (i > 0) {
cnt++;
sum += abs(r[i][j] - r[i-1][j]) + abs(g[i][j] - g[i-1][j]) + abs(b[i][j] - b[i-1][j-1]);
}
if (j + 1 < w) {
cnt++;
sum += abs(r[i][j] - r[i][j+1]) + abs(g[i][j] - g[i][j+1]) + abs(b[i][j] - b[i][j+1]);
}
if (i + 1 < h) {
cnt++;
sum += abs(r[i][j] - r[i+1][j]) + abs(g[i][j] - g[i+1][j]) + abs(b[i][j] - b[i+1][j]);
}
}
}
ll mean = sum / cnt;
//cout << mean << endl;
if (mean >= 57) return 3;
if (mean >= 24) return 2;
if (mean >= 10) return 1;
return 4;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |