제출 #257699

#제출 시각아이디문제언어결과실행 시간메모리
257699davi_bart미술 수업 (IOI13_artclass)C++14
0 / 100
76 ms4088 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> #include "artclass.h" using namespace std; typedef long long ll; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int e=15; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { int r=0,g=0,b=0; int diff=0,tot=0; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ r+=R[i][j]; g+=G[i][j]; b+=B[i][j]; if(i>0){ tot++; if(abs(R[i][j]-R[i-1][j])+abs(G[i][j]-G[i-1][j])+abs(B[i][j]-B[i-1][j])>e)diff++; } if(j>0){ tot++; if(abs(R[i][j]-R[i][j-1])+abs(G[i][j]-G[i][j-1])+abs(B[i][j]-B[i][j-1])>e)diff++; } } } int x=diff*100/tot; cout<<x<<" "; if(x<10)return 4; if(x<45)return 1; if(x<70)return 2; return 3; //cout<<r/(H*W)<<" "<<g/(H*W)<<" "<<b/(H*W)<<" "<<diff*100/tot<<"%"<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...