제출 #426554

#제출 시각아이디문제언어결과실행 시간메모리
426554Aldas25미술 수업 (IOI13_artclass)C++14
6 / 100
69 ms6072 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define REP(n) FOR(O, 1, (n)) #define f first #define s second #define pb push_back typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pii> vii; typedef long long ll; typedef vector<ll> vl; typedef long double ld; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { ll sumR = 0, sumG = 0, sumB = 0; FOR(i, 0, H-1) FOR(j, 0, W-1) { sumR += R[i][j]; sumG += G[i][j]; sumB += B[i][j]; } //cout << " sumR = " << sumR << " sumG = " << sumG << " sumB = " << sumB << endl; ll area = ((ll)H)*((ll)W); ld avR = ((ld)sumR) / ((ld)area); ld avG = ((ld)sumG) / ((ld)area); ld avB = ((ld)sumB) / ((ld)area); //cout << fixed << setprecision(3) << " avR = " << avR << " avG = " << avG << " avB = " << avB << endl; int ans = 1; if (avB < min(avR, avG) - 25.0) ans =2; //cout << " ans = " << ans << endl; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...