Submission #1012548

#TimeUsernameProblemLanguageResultExecution timeMemory
1012548parsadox2Art Class (IOI13_artclass)C++17
0 / 100
157 ms7512 KiB
#include <bits/stdc++.h> #include "artclass.h" using namespace std; int sr[500][500] , sg[500][500] , sb[500][500]; int style(int h , int w , int R[500][500] , int G[500][500] , int B[500][500]) { srand(time(NULL)); int sum = 0 , all = 0 , eq = 0; for(int i = 0 ; i < w ; i++) for(int j = 0 ; j < h ; j++) for(int ii = max(i - 10 , 0) ; ii <= i ; ii++) { for(int jj = max(j - 10 , 0) ; jj <= min(h - 1 , j + 10) ; jj++) { int tmp = 0; tmp = max({abs(R[i][j] - R[ii][jj]) , abs(G[i][j] - G[ii][jj]) , abs(B[i][j] - B[ii][jj])}); if(tmp <= 10) eq++; } } for(int i = 0 ; i < w ; i++) for(int j = 0 ; j < h ; j++) { all++; int r = R[i][j] , g = G[i][j] , b = B[i][j]; if(g + 15 > r && g + 15 > b) sum++; } //cout << eq << " " << sum << " " << all << endl; long double t1 = 1.0 * eq / all; long double t2 = 1.0 * sum / all; cout << setprecision(6) << fixed << t1 << " " << t2 << endl; //all += all/5; vector <int> vec = {3 , 4}; if(t1 > 90) { if(t2 > 0.45) return 1; return 4; } if(t1 < 25) return 3; if(t2 > 0.8) return 2; return 3; } /*signed main() { freopen("sample4-01" , "r" , stdin); int h , w; cin >> h >> w; for(int i = 0 ; i < w ; i++) for(int j = 0 ; j < h ; j++) { cin >> sr[i][j] >> sg[i][j] >> sb[i][j]; } cout << style(h , w , sr , sg , sb) << endl; return 0; }*/
#Verdict Execution timeMemoryGrader output
Fetching results...