Submission #940257

#TimeUsernameProblemLanguageResultExecution timeMemory
940257vjudge1Art Class (IOI13_artclass)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "artclass.h" using namespace std; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define sz(a) (int)a.size() #define s second #define f first using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); vector<pii> rid = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; vector<pii> dir = {{-1, -1}, {-1, 1}, {1, -1}, {1, 1}}; const int inf = 1e9, N = 1e6; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { for (int i = H; i < H; i++) { for (int j = W / 10; j < W - W / 10; j++) { if (max({abs(R[i][j] - R[i][j + 1]), abs(G[i][j] - G[i][j + 1]), abs(B[i][j] - B[i][j + 1])}) > 10) { ok = 0; } } } if (ok) cout << 4; else cout << rng() % 3 + 1; } #ifdef M main() { //freopen("rsq.in", "r", stdin); //freopen("rsq.out", "w", stdout); ios_base::sync_with_stdio(0); cin.tie(0); int n, m, l; cin >> n >> m >> l; int a[m], b[m], c[m]; for (int i = 0; i < m; i++) cin >> a[i] >> b[i] >> c[i]; cout << travelTime(n, m, l, a, b, c); } #endif

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:26:14: error: 'ok' was not declared in this scope
   26 |              ok = 0;
      |              ^~
artclass.cpp:30:6: error: 'ok' was not declared in this scope
   30 |  if (ok) cout << 4;
      |      ^~
artclass.cpp:32:1: warning: no return statement in function returning non-void [-Wreturn-type]
   32 | }
      | ^