#include <bits/stdc++.h>
#include "artclass.h"
using namespace std;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
constexpr int d = 20;
int style(int n, int m, int r[500][500], int g[500][500], int b[500][500]) {
bool is_4 = 1;
for (int i = 1; i < n; i++) {
for (int j = 1; j < m; j++) {
int dist_r = abs(r[i][j] - r[i - 1][j]);
int dist_g = abs(g[i][j] - g[i - 1][j]);
int dist_b = abs(b[i][j] - b[i - 1][j]);
if (max({dist_r, dist_b, dist_g}) > 20) {
is_4 = 0;
break;
}
}
}
if (is_4) return 4;
return rng() % 3 + 1;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |