Submission #474730

#TimeUsernameProblemLanguageResultExecution timeMemory
474730ValiAntonieArt Class (IOI13_artclass)C++14
1 / 100
80 ms3264 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; int style(int n, int m, int R[500][500], int G[500][500], int B[500][500]) { int i = 0, j = 0, nrverde = 0, nralb = 0, nrnegru = 0, nrrosu = 0; for(i=0;i<n;i++){ for(j=0;j<m;j++){ if(G[i][j] > R[i][j] && G[i][j] > B[i][j]) nrverde++; if(G[i][j] == 255 && R[i][j] == 255 && B[i][j] == 255) nralb++; if(G[i][j] == 0 && R[i][j] == 0 && B[i][j] == 0) nrnegru++; if(R[i][j] > G[i][j] && R[i][j] > B[i][j]) nrrosu++; } } if(nrverde > (n * m) / 2 && nrrosu < (n * m) / 4) return 2; else if(nralb > (n * m) / 2 && nrrosu < (n * m) / 4) return 3; else if(nrnegru > (n * m) / 6 && nrrosu > (n * m) / 6 && nralb > (n * m) / 6) return 1; else return 4; }
#Verdict Execution timeMemoryGrader output
Fetching results...