Submission #681300

#TimeUsernameProblemLanguageResultExecution timeMemory
681300whqkrtk04Art Class (IOI13_artclass)C++17
78 / 100
73 ms6124 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pii> piii; typedef pair<ll, ll> pll; typedef pair<ll, pll> plll; #define fi first #define se second const int INF = 1e9+1; const int P = 1000000007; const ll LLINF = (ll)1e18+1; template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { for(auto i : v) os << i << " "; os << "\n"; return os; } template <typename T1, typename T2> ostream& operator<<(ostream& os, const pair<T1, T2>& p) { os << p.fi << " " << p.se; return os; } double diffx(int arr[500][500], int i, int j) { if(!j) return 0; return abs(arr[i][j]-arr[i][j-1]); } double diffy(int arr[500][500], int i, int j) { if(!i) return 0; return abs(arr[i][j]-arr[i-1][j]); } int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { double a = 0, b = 0, d = 0; int c = 0; for(int i = 0; i < H; i++) { for(int j = 0; j < W; j++) { a += (diffx(R, i, j)+diffx(G, i, j)+diffx(B, i, j))/H/(W-1)/2; a += (diffy(R, i, j)+diffy(G, i, j)+diffy(B, i, j))/(H-1)/W/2; d += (diffx(R, i, j)+diffx(G, i, j)+diffx(B, i, j))/H/(W-1)/2; b += (double)G[i][j]/H/W; if(R[i][j] < 5 || G[i][j] < 5 || B[i][j] < 5 || R[i][j] > 250 || G[i][j] > 250 || B[i][j] > 250) c++; } } //cout << a << " " << b << " " << c << " " << d << "\n"; if(a < 5 || d < 4.1) return 4; if(b < 100) return 2; if(a > 50 || d > 30) return 3; if(c < 16000) return 2; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...