Submission #763346

#TimeUsernameProblemLanguageResultExecution timeMemory
763346SanguineChameleonArt Class (IOI13_artclass)C++17
87 / 100
54 ms6036 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; int style(int N, int M, int R[500][500], int G[500][500], int B[500][500]) { int sum = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < M - 1; j++) { sum += abs(R[i][j] - R[i][j + 1]); sum += abs(G[i][j] - G[i][j + 1]); sum += abs(B[i][j] - B[i][j + 1]); } } for (int i = 0; i < N - 1; i++) { for (int j = 0; j < M; j++) { sum += abs(R[i][j] - R[i + 1][j]); sum += abs(G[i][j] - G[i + 1][j]); sum += abs(B[i][j] - B[i + 1][j]); } } long double avg = 1.0L * sum / ((N * (M - 1) + (N - 1) * M) * 3); if (avg <= 2.5L) { return 4; } else if (avg <= 9.5L) { return 1; } else if (avg <= 19.5L) { return 2; } else { return 3; } }
#Verdict Execution timeMemoryGrader output
Fetching results...