Submission #753784

#TimeUsernameProblemLanguageResultExecution timeMemory
753784minhcoolArt Class (IOI13_artclass)C++17
Compilation error
0 ms0 KiB
#include "artclass.h" #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define fi first #define se second #define pb push_back #define mp make_pair typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<ii, ii> iiii; const int N = 3e5 + 5; const int oo = 1e18 + 7, mod = 1e9 + 7; mt19937 rng(1); int rnd(int l, int r){ int temp = rng() % (r - l + 1); return abs(temp) + l; } int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]){ int cnt = 0; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ if(i < H){ int sum = 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(sum <= 100) cnt++; } if(i < W){ int sum = abs(R[i][j] - R[i][j + 1]) + abs(G[i][j] - G[i][j + 1]) + abs(B[i][j] - B[i][j + 1]); if(sum <= 100) cnt++; } } } if(cnt * 10 <= H * W) return 4; else{ int cnt = 0; for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ if(G[i][j] == max(B[i][j], R[i][j], G[i][j])) cnt++; } } if(cnt * 2 > H * W) return 2; return (rnd(0, 1) ? 1 : 3); } }

Compilation message (stderr)

artclass.cpp:18:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   18 | const int oo = 1e18 + 7, mod = 1e9 + 7;
      |                ~~~~~^~~
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from artclass.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
artclass.cpp:46:48:   required from here
/usr/include/c++/10/bits/stl_algobase.h:303:17: error: '__comp' cannot be used as a function
  303 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~