# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
481832 | theshadow_04 | Quality Of Living (IOI10_quality) | C++17 | 1668 ms | 142044 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 3005;
int r, c, h, w, p[maxn][maxn];
int small[maxn][maxn], big[maxn][maxn];
int Get1(int x, int y, int u, int v) {
return small[u][v] - small[u][y - 1] - small[x - 1][v] + small[x - 1][y - 1];
}
int Get2(int x, int y, int u, int v) {
return big[u][v] - big[u][y - 1] - big[x - 1][v] + big[x - 1][y - 1];
}
bool Check(int x) {
for(int i = 1; i <= r; ++ i) {
for(int j = 1; j <= c; ++ j) {
small[i][j] = small[i - 1][j] + small[i][j - 1] - small[i - 1][j - 1] + (p[i][j] < x);
big[i][j] = big[i - 1][j] + big[i][j - 1] - big[i - 1][j - 1] + (p[i][j] > x);
}
}
for(int i = h; i <= r; ++ i) {
for(int j = w; j <= c; ++ j) {
int cur1 = Get1(i - h + 1, j - w + 1, i, j);
int cur2 = Get2(i - h + 1, j - w + 1, i, j);
if(cur1 >= cur2) return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |