Submission #801877

#TimeUsernameProblemLanguageResultExecution timeMemory
801877LittleCubeArt Class (IOI13_artclass)C++17
65 / 100
69 ms3540 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { double avgR = 0, avgG = 0, avgB = 0; double diff = 0; for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) avgR += R[i][j], avgG += G[i][j], avgB += B[i][j]; for (int i = 3; i + 3 < H; i++) for (int j = 3; j + 3 < W; j++) for (int x = i - 3; x <= i + 3; x++) for (int y = j - 3; y <= j + 3; y++) diff += (R[i][j] - R[x][y]) * (R[i][j] - R[x][y]) + (G[i][j] - G[x][y]) * (G[i][j] - G[x][y]) + (B[i][j] - B[x][y]) * (B[i][j] - B[x][y]); avgR /= H * W, avgG /= H * W, avgB /= H * W; diff /= H * W; // cerr << avgR + avgG + avgB << ' ' << diff << '\n'; if(diff <= 30000.0) return 4; if (diff <= 100000.0) return 2; if(diff <= 300000.0) return 1; return 3; }
#Verdict Execution timeMemoryGrader output
Fetching results...