Submission #491375

#TimeUsernameProblemLanguageResultExecution timeMemory
491375dxz05Art Class (IOI13_artclass)C++14
0 / 100
53 ms6036 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]) { int rr = 0, gg = 0, bb = 0; for (int i = 0; i < H; i++){ for (int j = 0; j < W; j++){ rr += R[i][j]; gg += G[i][j]; bb += B[i][j]; } } int x = H * W; //cout << endl << rr / x << ' ' << gg / x << ' ' << bb / x << endl; if (rr > gg) return 2; if (1.0 * min(gg, rr) / max(gg, rr) >= 0.7) return 4; return 1; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:16:9: warning: unused variable 'x' [-Wunused-variable]
   16 |     int x = H * W;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...