Submission #512657

#TimeUsernameProblemLanguageResultExecution timeMemory
512657Markomafko972Quality Of Living (IOI10_quality)C++14
Compilation error
0 ms0 KiB
#include "quality.h" int rectangle(int n, int m, int h, int w, int a[3005][3005]) { int p[3005][3005]; for (int i = n-1; i >= 0; i--) { for (int j = m-1; j >= 0; j--) { a[i+1][j+1] = a[i][j]; } } int lo = 1, hi = n*m; while (lo < hi) { int mid = (lo + hi) / 2; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { p[i][j] = 0; if (a[i][j] <= mid) p[i][j] = 1; p[i][j] += p[i-1][j]+p[i][j-1]-p[i-1][j-1]; } } int da = 0; for (int i = h; i <= n; i++) { for (int j = w; j <= m; j++) { if (p[i][j]-p[i-h][j]-p[i][j-w]+p[i-h][j-w] > (h*w)/2) { da = 1; break; } } if (da) break; } if (da) hi = mid; else lo = mid+1; } return lo; }

Compilation message (stderr)

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