# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
734883 | 2023-05-03T08:11:53 Z | phoebe | 삶의 질 (IOI10_quality) | C++17 | 15 ms | 35668 KB |
#include <bits/stdc++.h> #include "quality.h" using namespace std; int rectangle(int R, int C, int H, int W, int Q[3001][3001]){ int prefix[3001][3001]; int l = 0, r = 3001 * 3001, ans; while (l <= r){ int mid = (l + r) / 2; for (int i = 0; i <= R; i++) prefix[i][0] = 0; for (int j = 0; j <= C; j++) prefix[0][j] = 0; for (int i = 1; i <= R; i++){ for (int j = 1; j <= C; j++){ if (Q[i - 1][j - 1] >= mid) prefix[i][j] = 1; else prefix[i][j] = -1; prefix[i][j] += prefix[i][j - 1]; } } for (int i = 1; i <= R; i++){ for (int j = 1; j <= C; j++) prefix[i][j] += prefix[i - 1][j]; } bool pos = false; for (int i = H; i <= R; i++){ for (int j = W; j <= C; j++){ int val = prefix[i][j] - prefix[i - H][j] - prefix[i][j - W] + prefix[i - H][j - W]; if (val + val > H * W) pos = true; } } if (pos) ans = mid, r = mid - 1; else l = mid + 1; } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 35668 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 35668 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 35668 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 35668 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 35668 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |