# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
355243 | talant117408 | Art Class (IOI13_artclass) | C++17 | 80 ms | 9344 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"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
#define precision(n) fixed << setprecision(n)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define eps (double)1e-9
#define PI 2*acos(0.0)
#define endl "\n"
#define sz(v) int((v).size())
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define OK cout << "OK" << endl;
int cnt = 1, sr, sg, sb;
double n, m;
double used[501][501], r[501][501], g[501][501], b[501][501];
int movesX[] = {-1, 0, 0, 1}, movesY[] = {0, -1, 1, 0};
bool isEligible(int x, int y){
return x > -1 && x < n && y > -1 && y < m;
}
void dfs(int x, int y){
used[x][y] = cnt;
for(int i = 0; i < 4; i++){
auto nx = x+movesX[i];
auto ny = y+movesY[i];
if(isEligible(nx, ny) && !used[nx][ny] && abs(r[nx][ny]-sr) < 50 && abs(g[nx][ny]-sg) < 50 && abs(b[nx][ny]-sb) < 50){
dfs(nx, ny);
}
}
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]){
n = H; m = W;
int i, j;
for(i = 0; i < n; i++){
for(j = 0; j < m; j++){
r[i][j] = R[i][j];
g[i][j] = G[i][j];
b[i][j] = B[i][j];
}
}
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |