Submission #355390

#TimeUsernameProblemLanguageResultExecution timeMemory
355390kylych03Art Class (IOI13_artclass)C++14
100 / 100
69 ms4588 KiB
#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 n, m; 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, cnt = 0; ll diff = 0; for(i = 0; i < n; i++){ for(j = 0; j < m-1; j++){ diff += abs(r[i][j]-r[i][j+1])+abs(g[i][j]-g[i][j+1])+abs(b[i][j]-b[i][j+1]); cnt++; } } for(i = 0; i < n-1; i++){ for(j = 0; j < m; j++){ diff += abs(r[i][j]-r[i+1][j])+abs(g[i][j]-g[i+1][j])+abs(b[i+1][j]-b[i][j]); cnt++; } } diff /= cnt; if(diff <= 10) return 4; if(diff <= 26) return 1; if(diff<=60)return 2; return 3; }
#Verdict Execution timeMemoryGrader output
Fetching results...