Submission #511025

#TimeUsernameProblemLanguageResultExecution timeMemory
511025tabrQuality Of Living (IOI10_quality)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #ifdef tabr #include "library/debug.cpp" #else #define debug(...) #endif int rectangle(int r, int c, int h, int w, vector<vector<int>> q) { int low = 0; int high = r * c; while (high - low > 1) { int mid = (high + low) / 2; int ok = 0; vector<vector<int>> pref(r + 1, vector<int>(c + 1)); for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { pref[i + 1][j + 1] = pref[i + 1][j] + pref[i][j + 1] - pref[i][j] + (q[i][j] >= mid); } } for (int i = 0; i <= r - h; i++) { for (int j = 0; j <= c - w; j++) { if (pref[i + h][j + w] - pref[i][j + 1] - pref[i + h][j] + pref[i][j] > h * w / 2) { ok = 1; } } } if (ok) { low = mid; } else { high = mid; } } return low; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc2akqgv.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