Submission #257691

#TimeUsernameProblemLanguageResultExecution timeMemory
257691davi_bartArt Class (IOI13_artclass)C++14
62 / 100
112 ms6136 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> #include "artclass.h" using namespace std; typedef long long ll; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int e=10; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { int r=0,g=0,b=0; int diff=0,tot=0; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ r+=R[i][j]; g+=G[i][j]; b+=B[i][j]; if(i>0){ tot++; if(abs(R[i][j]-R[i-1][j])+abs(G[i][j]-G[i-1][j])+abs(B[i][j]-B[i-1][j])>e)diff++; } if(j>0){ tot++; if(abs(R[i][j]-R[i][j-1])+abs(G[i][j]-G[i][j-1])+abs(B[i][j]-B[i][j-1])>e)diff++; } } } int x=diff*100/tot; if(x<20)return 4; if(x<57)return 1; if(x<80)return 2; return 3; //cout<<r/(H*W)<<" "<<g/(H*W)<<" "<<b/(H*W)<<" "<<diff*100/tot<<"%"<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...