# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
776357 | tolbi | Art Class (IOI13_artclass) | C++17 | 83 ms | 6220 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.
#pragma optimize("Bismillahirrahmanirrahim")
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
#define author tolbi
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define sortarr(x) sort(x.begin(), x.end())
#define sortrarr(x) sort(x.rbegin(), x.rend())
#define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl;
#define rev(x) reverse(x.begin(), x.end())
#define tol(bi) (1LL<<((int)(bi)))
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
typedef long long ll;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#include "artclass.h"
int r[500][500];
int g[500][500];
int b[500][500];
int delta_g(pair<int,int> ac, pair<int,int> bc){
return
abs(r[ac.first][ac.second]-r[bc.first][bc.second])+
abs(g[ac.first][ac.second]-g[bc.first][bc.second])+
abs(b[ac.first][ac.second]-b[bc.first][bc.second]);
}
int style(int n, int m, int R[500][500], int G[500][500], int B[500][500]) {
for (int i = 0; i < 500; i++){
for (int j = 0; j < 500; j++){
r[i][j]=R[i][j];
g[i][j]=G[i][j];
b[i][j]=B[i][j];
}
}
int say = 0;
int treshold1=50;
int treshold2=10000;
double treshold3=0.8;
int treshold4=100;
int grsay = 0;
for (int i = 0; i < 500; i++){
for (int j = 0; j < 500; j++){
if (i && delta_g({i,j},{i-1,j})<treshold1) say++;
if (j && delta_g({i,j},{i-1,j})<treshold1) say++;
if (g[i][j]*treshold3>b[i][j] && b[i][j]>r[i][j]) grsay++;
}
}
if (say>treshold2){
if (grsay>treshold4) return 2;
return 3;
}
return (ayahya()%2)*3+1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |