Submission #969227

#TimeUsernameProblemLanguageResultExecution timeMemory
969227anangoArt Class (IOI13_artclass)C++17
0 / 100
50 ms7252 KiB
#include "artclass.h" #include <bits/stdc++.h> using namespace std; bool bounds(int x, int y) { return (0<=x && x<500 && 0<=y && y<500); } int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { double bl=0; int T[500][500]; vector<int> dx={0,0,-1,1}; vector<int> dy={1,-1,0,0}; for (int i=0; i<500; i++) { for (int j=0; j<500; j++) { T[i][j] = (R[i][j]+G[i][j]+B[i][j])/3; } } for (int i=0; i<500; i++) { for (int j=0; j<500; j++) { for (int d=0; d<4; d++) { int nx=i+dx[d]; int ny=j+dy[d]; if (!bounds(nx,ny)) { continue; } bl+=abs(T[nx][ny]-T[i][j]); } } } bl = bl/500/500; cout << bl << endl; if (bl<11) { return 4; } if (bl<29) { return 1; } if (bl<50) { return 2; } return 3; }
#Verdict Execution timeMemoryGrader output
Fetching results...