제출 #788893

#제출 시각아이디문제언어결과실행 시간메모리
788893NothingXDArt Class (IOI13_artclass)C++17
54 / 100
61 ms4048 KiB
#include <bits/stdc++.h> #include "artclass.h" using namespace std; void debug_out(){cerr << endl;} template<typename Head, typename... Tail> void debug_out(Head H, Tail... T){ cerr << H << ' '; debug_out(T...); } #define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__) int style(int n, int m, int r[500][500], int g[500][500], int b[500][500]) { double diff = 0, white = 0; for (int i = 0; i < n; i++){ for (int j = 0; j < m; j++){ if (i){ diff += abs(r[i][j] - r[i-1][j]) + abs(g[i][j] - g[i-1][j]) + abs(b[i][j] - b[i-1][j]); } if (j){ diff += abs(r[i][j] - r[i][j-1]) + abs(g[i][j] - g[i][j-1]) + abs(b[i][j] - b[i][j-1]); } if (min({r[i][j], b[i][j], g[i][j]}) >= 200) white++; } } diff /= (n*m); white /= (n*m); //debug(diff, white); if (white < 0.1){ if (diff <= 20) return 4; return 2; } if (diff <= 20) return 4; if (diff <= 50) return 1; if (diff <= 100) return 2; return 3; }
#Verdict Execution timeMemoryGrader output
Fetching results...