Submission #290137

#TimeUsernameProblemLanguageResultExecution timeMemory
290137b00n0rpArt Class (IOI13_artclass)C++17
0 / 100
402 ms65540 KiB
#include "artclass.h" #include<bits/stdc++.h> using namespace std; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { vector<int> v; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ for(int k = i; k < min(i+10,H); k++){ for(int l = j; l < min(j+10,W); l++){ if(i == k and j == l) continue; int val = (R[i][j]-R[k][l])*(R[i][j]-R[k][l]); val += (G[i][j]-G[k][l])*(G[i][j]-G[k][l]); val += (B[i][j]-B[k][l])*(B[i][j]-B[k][l]); v.push_back(val); } } } } sort(v.begin(),v.end()); long long sm = 0; for(int i = 0; i < (int)v.size(); i++){ sm += v[i]; } int med = v[(int)v.size()/2]; int avg = (sm)/(long long)(v.size()); long long prod = ((long long)med*avg); double div = ((double)avg/med); if(div > 10 and avg > 1000) return 1; if(med < 150) return 4; if(med < 2500) return 2; return 3; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:28:15: warning: unused variable 'prod' [-Wunused-variable]
   28 |     long long prod = ((long long)med*avg);
      |               ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...