Submission #1014156

#TimeUsernameProblemLanguageResultExecution timeMemory
1014156ZanPArt Class (IOI13_artclass)C++17
0 / 100
39 ms6224 KiB
#include "artclass.h" #include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <string> #define ll long long using namespace std; struct color { ll r = 0, g = 0, b = 0; color(){} }; ll w, h; vector<vector<color>> image; ifstream imgfile; vector<color> averages; void print_color(color c) { cout << "{ r:" << c.r << " , g:" << c.g << " , b:" << c.b << " }"; } color avg_color() { color avg; for (int i = 0; i < h; i++)for (int j = 0; j < w; j++) { avg.r += image[i][j].r; avg.g += image[i][j].g; avg.b += image[i][j].b; } avg.r /= (w * h); avg.g /= (w * h); avg.b /= (w * h); return avg; } int style(int H,int W, int R[500][500],int G[500][500],int B[500][500]) { image.resize(h, vector<color>(w)); for (int i = 0; i < h; i++)for (int j = 0; j < w; j++) { image[i][j].r = R[i][j]; image[i][j].g = G[i][j]; image[i][j].b = B[i][j]; } color avg = avg_color(); ll sum = avg.r + avg.b + avg.g; if(sum < 300){return 2;} if(sum < 350){return 4;} if(sum < 450){return 3;} return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...