# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383602 | Keshi | Art Class (IOI13_artclass) | C++17 | 101 ms | 3328 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.
//In the name of God
#include <bits/stdc++.h>
#include "artclass.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
const ll maxn = 2e5 + 100;
const ll mod = 1e9 + 7;
const ll inf = 1e18;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io freopen("input.txt", "r+", stdin);freopen("output.txt", "w+", stdout);
#define pb push_back
#define Mp make_pair
#define F first
#define S second
#define Sz(x) ll((x).size())
#define all(x) (x).begin(), (x).end()
bool ok(ll r1, ll g1, ll b1, ll r2, ll g2, ll b2){
return (abs(r1 - r2) + abs(g1 - g2) + abs(b1 - b2) > 30);
}
int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) {
ll t = 0;
for(ll i = 1; i < h; i++){
for(ll j = 1; j < w; j++){
if(ok(r[i][j], g[i][j], b[i][j], r[i - 1][j], g[i - 1][j], b[i - 1][j]) ||
(ok(r[i][j], g[i][j], b[i][j], r[i][j - 1], g[i][j - 1], b[i][j - 1]))){
t++;
}
}
}
long double x = (1.0 * t) / (1.0 * w * h) * 100;
if(x < 5) return 4;
if(x < 35) return 1;
if(x < 65) return 2;
return 3;
}
/*int main(){
fast_io;
return 0;
}*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |