Submission #753781

#TimeUsernameProblemLanguageResultExecution timeMemory
753781minhcoolArt Class (IOI13_artclass)C++17
0 / 100
61 ms6124 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 return rnd(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;
      |                ~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...