Submission #64545

#TimeUsernameProblemLanguageResultExecution timeMemory
64545TadijaSebezArt Class (IOI13_artclass)C++11
4 / 100
131 ms62236 KiB
#include "artclass.h" #include <stdio.h> const int N=500; int max(int a, int b){ return a>b?a:b;} int min(int a, int b){ return a>b?b:a;} int style(int n, int m, int r[N][N], int g[N][N], int b[N][N]) { int i,j,green=0,yellow=0,gray=0,white=0; for(i=0;i<n;i++) { for(j=0;j<m;j++) { if(min(r[i][j],min(g[i][j],b[i][j]))>=200) white++; else if(min(r[i][j],min(g[i][j],b[i][j]))>100 && max(r[i][j],max(g[i][j],b[i][j]))<150) gray++; else if(g[i][j]>200 && r[i][j]<50 && b[i][j]<50) green++; else if(g[i][j]>160 && b[i][j]>160 && r[i][j]<50) yellow++; } } int Max=max(max(green,yellow),max(gray,white)); if(Max==gray) return 3; if(Max==white) return 1; if(Max==green) return 2; if(Max==yellow) return 4; return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...