# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
801871 | PixelCat | Art Class (IOI13_artclass) | C++14 | 62 ms | 6032 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 "artclass.h"
#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
using namespace std;
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
long long tot = 0;
long long sr = 0;
long long sg = 0;
long long sb = 0;
For(i, 0, H - 1) For(j, 0, W - 1) {
sr += R[i][j];
sg += G[i][j];
sb += B[i][j];
if(i) {
tot += abs(R[i][j] - R[i - 1][j]);
tot += abs(G[i][j] - G[i - 1][j]);
tot += abs(B[i][j] - B[i - 1][j]);
}
if(j) {
tot += abs(R[i][j] - R[i][j - 1]);
tot += abs(G[i][j] - G[i][j - 1]);
tot += abs(B[i][j] - B[i][j - 1]);
}
if(i && j) {
tot += abs(R[i][j] - R[i - 1][j - 1]);
tot += abs(G[i][j] - G[i - 1][j - 1]);
tot += abs(B[i][j] - B[i - 1][j - 1]);
}
if(i < H - 1 && j) {
tot += abs(R[i][j] - R[i + 1][j - 1]);
tot += abs(G[i][j] - G[i + 1][j - 1]);
tot += abs(B[i][j] - B[i + 1][j - 1]);
}
}
#ifdef NYAOWO
fstream fs;
fs.open("./solver_output.txt", ios::out);
fs << tot << "\n";
fs << sr << "\n";
fs << sg << "\n";
fs << sb << "\n";
fs.close();
#endif
if(tot < 10000000) return 4;
if(tot > 30000000) return 3;
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |