Submission #420023

#TimeUsernameProblemLanguageResultExecution timeMemory
420023OzyArt Class (IOI13_artclass)C++17
3 / 100
90 ms3664 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int i = (a); i <= (b); i++) #define repa(i,a,b) for (int i = (a); i >= (b); i--) #define lli long long int #define debugsl(a) cout << #a << " = " << a << ", " #define debug(a) cout << #a << " = " << a << endl lli verdes,rojos,azules,num,a; unordered_map<lli,lli> colores; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { rep(i,0,H-1) { rep(j,0,W-1) { R[i][j] >>= 5; G[i][j] >>= 5; B[i][j] >>= 5; if (R[i][j] > G[i][j] && R[i][j] > B[i][j]) rojos++; else if (B[i][j] > G[i][j] && B[i][j] > R[i][j]) azules++; else verdes++; a = R[i][j] + (1000 * B[i][j]) + (1000000 *G[i][j]); if (colores[a] == 0) num++; colores[a] = 1; } } if (num < 50) return 1; if (verdes > rojos && verdes > azules) return 2; if (rojos > verdes && rojos > azules) return 4; return 3; }
#Verdict Execution timeMemoryGrader output
Fetching results...