# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
747887 | boyliguanhan | Pyramid Base (IOI08_pyramid_base) | C++17 | 293 ms | 262144 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<bits/stdc++.h>
using namespace std;
int arr[10001][10001], n, m, p;
bool check(int l) {
for(int i = l; i <= n; i++)
for(int j = l; j <= m; j++)
if((arr[i][j]-arr[i-l][j] - arr[i][j-l] + arr[i-l][j-l]) == 0) {
return 1;
}
return 0;
}
int main() {
cin >> n >> m >> p >> p;
for(int i = 0; i < p; i++) {
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
arr[a][b]++;
arr[a][d+1]--;
arr[c+1][b]--;
arr[c+1][d+1]++;
}
for(int i = 1; i <= n; i++)
for(int j = 1; j <= m; j++)
arr[i][j] += arr[i-1][j]+arr[i][j-1]-arr[i-1][j-1];
for(int i = 1; i <= n; i++)
for(int j = 1; j <= m; j++)
arr[i][j] += arr[i-1][j]+arr[i][j-1]-arr[i-1][j-1];
int l = 0, r = min(n, m);
while(l < r) {
int mid = l+r+1>>1;
if(check(mid)) {
l = mid;
} else {
r = mid-1;
}
}
cout << l << '\n';
}
Compilation message (stderr)
# | 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... |
# | 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... |
# | 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... |