# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884922 | lis13 | Art Class (IOI13_artclass) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}