# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
283186 | kevlee | Art Class (IOI13_artclass) | C++17 | 95 ms | 5368 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>
using namespace std;
#define pb push_back
#define mod 1000000007
#define h1 7897897897897897
#define h2 7897466719774591
#define b1 98762051
#define b2 98765431
#define inf 1000000000
#define pi 3.1415926535897932384626
#define LMAX 9223372036854775807
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pii>
#define SET(a, b) memset(a, b, sizeof(a));
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
int black = 0;
int same = 0, old = 0;
FOR(i, 0, h-1) {
FOR(j, 0, w-1) {
if (g[i][j] >= 150) {
black++;
}
if (j > 0 && abs(r[i][j] - r[i][j-1]) + abs(g[i][j] - g[i][j-1]) + abs(b[i][j] - b[i][j-1]) <= 20) {
same++;
old++;
} else if (i > 0 && abs(r[i][j] - r[i-1][j]) + abs(g[i][j] - g[i-1][j]) + abs(b[i][j] - b[i-1][j-1]) <= 20) {
same++;
} else if (j + 1 < w && abs(r[i][j] - r[i][j+1]) + abs(g[i][j] - g[i][j+1]) + abs(b[i][j] - b[i][j+1]) <= 20) {
same++;
} else if (i + 1 < h && abs(r[i][j] - r[i+1][j]) + abs(g[i][j] - g[i+1][j]) + abs(b[i][j] - b[i+1][j]) <= 20) {
same++;
}
}
}
int same_percent = round(same * 100.0 / (1.0 * h * w));
// cout << "same " << same_percent << endl;
int old_percent = round(old * 100.0 / (1.0 * h * w));
//cout << "old " << old_percent << endl;
if (old_percent >= 95) return 4;
if (old_percent >= 65) return 1;
if (same_percent >= 75) return 2;
return 3;
/*int white_percent = white * 100 / (h * w);
cout << "white " << white_percent << endl;
if (white_percent >= 10) return 1;
return 2;*/
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |