Submission #1130341

#TimeUsernameProblemLanguageResultExecution timeMemory
1130341bachnvQuality Of Living (IOI10_quality)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; ll n, m, h, w, x, pfs[3005][3005], q[3005][3005]; ll cmp(ll temp){ if(temp == x){ return 0; } else if(temp < x){ return 1; } else{ return -1; } } bool check(){ memset(pfs, 0, sizeof(pfs)); for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ pfs[i][j] = cmp(q[i][j]); if(i){ pfs[i][j] += pfs[i - 1][j]; } if(j){ pfs[i][j] += pfs[i][j - 1]; } if(i && j){ pfs[i][j] -= pfs[i - 1][j - 1]; } } } for(int i = 0; i + h - 1 < n; i++){ for(int j = 0; j + w - 1 < m; j++){ ll temp = pfs[i + h - 1][j + w - 1]; if(i){ temp -= pfs[i - 1][j + w - 1]; } if(j){ temp -= pfs[i + h - 1][j - 1]; } if(i && j){ temp += pfs[i - 1][j - 1]; } if(temp >= 0){ return true; } } } return false; } int rectangle(ll R, ll C, ll H, ll W, ll Q[3005][3005]){ n = R, m = C, h = H, w = W; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ q[i][j] = Q[i][j]; } } ll res; ll l = 1, r = n * m; while(l <= r){ x = (l + r) / 2; if(check()){ res = x; r = x - 1; } else{ l = x + 1; } } return res; }

Compilation message (stderr)

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