제출 #586621

#제출 시각아이디문제언어결과실행 시간메모리
586621yutabi미술 수업 (IOI13_artclass)C++14
67 / 100
66 ms6088 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; int green; int diff_h; int diff_v; int diff_h_b; int diff_v_b; int clear; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { for(int i=0;i<H;i++) { for(int j=0;j<W-1;j++) { 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])>50) { diff_h++; } 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])>100) { diff_h_b++; } } } for(int i=0;i<H-1;i++) { for(int j=0;j<W;j++) { 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])>50) { diff_v++; } 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])>100) { diff_v_b++; } } } for(int i=0;i<H;i++) { for(int j=0;j<W;j++) { //if(G[i][j]>R[i][j] && G[i][j]>B[i][j] && R[i][j]+B[i][j]<180 && G[i][j]>100) if(G[i][j]*7>R[i][j]*8 && G[i][j]*7>B[i][j]*8) { green++; } if((R[i][j]>200 || R[i][j]<50) && (G[i][j]>200 || G[i][j]<50) && (B[i][j]>200 || B[i][j]<50)) { clear++; } } } //printf("%d %d %d %d %d\n",diff_h,diff_v,diff_h_b,diff_v_b,clear); if(diff_h_b+diff_v_b<3000) { return 4; } if((diff_h+diff_v)*10>(diff_h_b+diff_v_b)*21) { return 2; } return 3; }
#Verdict Execution timeMemoryGrader output
Fetching results...