Submission #1216070

#TimeUsernameProblemLanguageResultExecution timeMemory
1216070GabrielArt Class (IOI13_artclass)C++20
94 / 100
33 ms3296 KiB
#include "artclass.h" #include "bits/stdc++.h" using namespace std; int style(int n, int m, int r[500][500], int g[500][500], int b[500][500]){ double Diferencia = -0; //cerr<<n<<" "<<m<<"\n"; for(long long i = 0; i < n; i++){ for(long long j = 0; j < m; j++){ //cerr<<i<<" "<<j<<"\n"; if(i + 1 < n) Diferencia += abs(r[i][j] - r[i + 1][j]) + abs(g[i][j] - g[i + 1][j]) + abs(b[i][j] - b[i + 1][j]); if(j + 1 < m) Diferencia += abs(r[i][j] - r[i][j + 1]) + abs(g[i][j] - g[i][j + 1]) + abs(b[i][j] - b[i][j + 1]); } } Diferencia /= (double)((n - 1) * m + (m - 1) * n); double _1 = (20 + 30 + 25 + 18 + 11 + 22 + 19 + 10 + 10) / 9; double _2 = (27 + 30 + 23 + 25 + 66 + 35 + 29 + 41 + 26) / 9; double _3 = (102 + 59 + 115 + 114 + 104 + 64 + 93 + 78 + 55) / 9; double _4 = (4 + 8 + 5 + 9 + 5 + 6 + 7 + 6 + 7) / 9; _1 = abs(_1 - Diferencia); _2 = abs(_2 - Diferencia); _3 = abs(_3 - Diferencia); _4 = abs(_4 - Diferencia); double Menor = 22222222; if(_1 < Menor) Menor = _1; if(_2 < Menor) Menor = _2; if(_3 < Menor) Menor = _3; if(_4 < Menor) Menor = _4; if(Menor == _1) return 1; if(Menor == _2) return 2; if(Menor == _3) return 3; if(Menor == _4) return 4; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...