# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
146445 | achibasadzishvili | Art Class (IOI13_artclass) | C++14 | 91 ms | 6140 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<bits/stdc++.h>
#include "artclass.h"
#define ll long long
#define f first
#define s second
#define pb push_back
using namespace std;
long long pp = 0;
int n;int m;int r[500][500];int g[500][500];int b[500][500],af;
int style(int n,int m,int r[500][500],int g[500][500],int b[500][500]){
for(int i=0; i<n; i++)
for(int j=0; j<m; j++)
for(int x=-1; x<=1; x++)
for(int y=-1; y<=1; y++)
if(i + x >= 0 && i + x < n && j + y >= 0 && j + y < m){
af += g[i][j] - r[i][j] - b[i][j];
pp += abs(r[i][j] - r[i + x][j + y]) * abs(g[i][j] - g[i + x][j + y]) *
abs(b[i][j] - b[i + x][j + y]);
}
// style 1 = 70726740182
// style 2 = 20327879800
// style 3 = 204620797406
// style 4 = 476357764
if(pp < 10000000000)return 4;
if(pp > 100000000000)return 3;
// -336086706 -143795040 -384767008 -339261760
// -92720033 -126623263 -158012475 -186706437
if(af >= -200000000)return 2;
return 1;
vector<ll>v;
v.pb(70726740182);
v.pb(20327879800);
ll mn = 100000000000000;
int ret;
for(int i=0; i<v.size(); i++){
if(abs(v[i] - pp) < mn){
mn = abs(v[i] - pp);
ret = i + 1;
}
}
//cout << af << endl;
}
/*
int main(){
ifstream cin("style-2-1.txt");
cin >> n >> m;
for(int i=0; i<n; i++)
for(int j=0; j<m; j++)
cin >> r[i][j] >> g[i][j] >> b[i][j];
style();
return 0;
}
*/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |