# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
884922 | lis13 | Art Class (IOI13_artclass) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int R[H][W]; int G[H][W]; int B[H][W];
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> R[i][j] >> G[i][j] >> B[i][j];
}
}
int tsn=0;
int sn;
for (int i = 0; i < H; i++) {
for (int j = 1; j < W; j++) {
tsn+=abs(R[j]-R[j-1])+abs(G[j]-G[j-1])+abs(B[j]-B[j-1]);
sn++;
}
}
double result = tsn / (double) sn;
if (result < 9) cout << 4;
else if (result < 18) cout << 1;
else if (result < 36) cout << 2;
else cout << 3;
return 0;
}