Submission #1216071

#TimeUsernameProblemLanguageResultExecution timeMemory
1216071GabrielArt Class (IOI13_artclass)C++20
98 / 100
37 ms3276 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); cerr<<Diferencia<<"\n"; double _1 = (19.5874 + 29.0755 + 24.6598 + 17.1009 + 10.1129 + 21.9903 + 18.1946 + 9.24826 + 9.40674) / 9; double _2 = (26.4781 + 29.6318 + 22.678 + 24.2319 + 55.7637 + 34.0157 + 28.342 + 40.8712 + 25.3746) / 9; double _3 = (101.939 + 58.333 + 114.388 + 113.638 + 103.276 + 63.5456 + 92.0683 + 77.7639 + 54.3654) / 9; double _4 = (3.55623 + 7.18252 + 4.19326 + 8.62284 + 4.39498 + 5.8055 + 6.01509 + 5.98363 + 6.07955) / 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:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...