(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 #1085032

#TimeUsernameProblemLanguageResultExecution timeMemory
1085032SunbaeQuality Of Living (IOI10_quality)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define z exit(0) using namespace std; const int N = 3005; int qs[N][N], a[N][N]; bool V(int i, int j, int m, int n){ return i>=0 && j>=0 && i<m && j<n;} int f(int i, int j, int m, int n){ return V(i, j, m, n) ? qs[i][j] : 0;} int rectangle(int m, int n, int kx, int ky, int a[][N]){ int low = 0, high = 1e9, ans; while(low <= high){ int mid = low + ((high-low)>>1); for(int i = 0; i<m; ++i) for(int j = 0; j<n; ++j) qs[i][j] = f(i-1, j, m, n) + f(i, j-1, m, n) + (a[i][j] <= mid) - f(i-1, j-1, m, n); bool ch = false; for(int i = kx-1; i<m; ++i){ for(int j = ky-1; j<n; ++j) if(qs[i][j] - f(i-kx, j, m, n) - f(i, j-ky, m, n) + f(i-kx, j-ky, m, n) > (kx*ky-1)/2){ch = true; break;} if(ch) break; } if(ch) high = mid-1, ans = mid; else low = mid+1; } return ans; } /* signed main(){ int m, n, kx, ky; scanf("%d %d %d %d", &m, &n, &kx, &ky); for(int i = 0; i<m; ++i){ for(int j = 0; j<n; ++j) scanf("%d", &a[i][j]); } printf("%d", rectangle(m, n, kx, ky, a)); } */

Compilation message (stderr)

quality.cpp: In function 'int rectangle(int, int, int, int, int (*)[3005])':
quality.cpp:21:9: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   21 |  return ans;
      |         ^~~
/usr/bin/ld: /tmp/ccJva3ji.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