제출 #681295

#제출 시각아이디문제언어결과실행 시간메모리
681295whqkrtk04미술 수업 (IOI13_artclass)C++17
84 / 100
61 ms6040 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; 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; } } //cout << a << "\n" << b << "\n"; if(a < 10) return 4; if(a > 40) return 3; if(b < 120) return 2; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...