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

#TimeUsernameProblemLanguageResultExecution timeMemory
1085034SunbaeQuality 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, t, p = kx * ky; 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) > (p-1)/2){ch = true; break;} if(ch) break; } if(ch) high = mid-1, t = mid; else low = mid+1; } return t; }

Compilation message (stderr)

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