Submission #681298

#TimeUsernameProblemLanguageResultExecution timeMemory
681298whqkrtk04Art Class (IOI13_artclass)C++17
65 / 100
71 ms3540 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; 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; b += (double)G[i][j]/H/W; if(R[i][j] < 10 || G[i][j] < 10 || B[i][j] < 10) c++; } } //cout << a << "\n" << b << "\n" << c << "\n"; if(a < 10) return 4; if(a > 40) return 3; if(b < 120 || c < 16000) return 2; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...