Submission #943459

#TimeUsernameProblemLanguageResultExecution timeMemory
943459IBoryQuality Of Living (IOI10_quality)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int MAX = 3003; int S[MAX][MAX], Y[MAX * MAX], X[MAX * MAX]; int main() { ios::sync_with_stdio(0); cin.tie(0); int N, M, H, W; cin >> N >> M >> H >> W; for (int i = 1; i <= N; ++i) for (int j = 1; j <= M; ++j) { int n; cin >> n; Y[n] = i, X[n] = j; } int L = 1, R = N * M; while (L + 1 < R) { int mid = (L + R) >> 1; memset(S, 0, sizeof(S)); for (int i = 1; i <= mid; ++i) S[Y[i]][X[i]] = 1; for (int i = 1; i <= N; ++i) for (int j = 1; j <= M; ++j) S[i][j] += S[i][j - 1]; for (int j = 1; j <= M; ++j) for (int i = 1; i <= N; ++i) S[i][j] += S[i - 1][j]; int high = 0; for (int i = H; i <= N; ++i) for (int j = W; j <= M; ++j) { int s = S[i][j] - S[i - H][j] - S[i][j - W] + S[i - H][j - W]; high = max(high, s); } ((H * W + 1) / 2 <= high ? R : L) = mid; } cout << R; return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccZOUjCK.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccvGUB5J.o:quality.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccZOUjCK.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