(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1101068

#TimeUsernameProblemLanguageResultExecution timeMemory
1101068SulAQuality Of Living (IOI10_quality)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define bitcount __builtin_popcountll using namespace std; using namespace __gnu_pbds; using namespace chrono; int rectangle(int n, int m, int h, int w, vector<vector<int>> a) { auto check = [&](int x) { vector<vector<int>> g(n, vector<int>(m, 0)); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { g[i][j] = a[i][j] <= x ? 1 : -1; if (i != 0) g[i][j] += g[i-1][j]; if (j != 0) g[i][j] += g[i][j-1]; if (i != 0 && j != 0) g[i][j] -= g[i-1][j-1]; } } auto sum = [&](int x1, int y1, int x2, int y2) { int sum = g[x2][y2]; if (x1 != 0) sum -= g[x1 - 1][y2]; if (y1 != 0) sum -= g[x2][y1 - 1]; if (x1 != 0 && y1 != 0) sum += g[x1 - 1][y1 - 1]; return sum; }; int mx = -h*w; for (int x1 = 0, x2 = h-1; x2 < n; x1++, x2++) { for (int y1 = 0, y2 = w-1; y2 < m; y1++, y2++) { int s = sum(x1, y1, x2, y2); mx = max(mx, s); } } return mx; }; int ans = 0; int l = 1, r = n*m; for (int i = l; i <= r; i++) if (check(i) > 0) return i; assert(false); }

Compilation message (stderr)

quality.cpp: In function 'int rectangle(int, int, int, int, std::vector<std::vector<int> >)':
quality.cpp:37:9: warning: unused variable 'ans' [-Wunused-variable]
   37 |     int ans = 0;
      |         ^~~
/usr/bin/ld: /tmp/ccoGay6Z.o: in function `main':
grader.cpp:(.text.startup+0xe9): undefined reference to `rectangle(int, int, int, int, int (*) [3001])'
collect2: error: ld returned 1 exit status