Submission #739150

#TimeUsernameProblemLanguageResultExecution timeMemory
739150grossly_overconfidentArt Class (IOI13_artclass)C++17
29 / 100
56 ms4684 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 one = 0, two = 0, three = 0, four = 0; for (int i = 0; i < h; ++i){ for (int j = 0; j < w; ++j){ if (g[i][j] > r[i][j] && g[i][j] > b[i][j]){ two += 1; } if (r[i][j] > 200 && g[i][j] > 200 && b[i][j] > 200){ one += 2; } if (r[i][j] > g[i][j] + 25 && r[i][j] > b[i][j] + 25){ four += 1; } if (b[i][j] > g[i][j] + 25 && b[i][j] > r[i][j] + 25){ four += 1; } } } if (max(max(one, two), four) < w * h / 5){ return 3; } if (two > one && two > four){ return 2; } if (four > one && four > two){ return 4; } return 1; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:5:27: warning: unused variable 'three' [-Wunused-variable]
    5 |     int one = 0, two = 0, three = 0, four = 0;
      |                           ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...