# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
765303 | Ahmed57 | Maxcomp (info1cup18_maxcomp) | C++17 | 112 ms | 68092 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;
long long mx1[3001][3001],mx2[3001][3001],mx3[3001][3001],mx4[3001][3001];
long long arr[3001][3001];
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int n,m;cin>>n>>m;
for(int i = 0;i<n;i++){
for(int j = 0;j<m;j++){
cin>>arr[i][j];
}
}
long long inf = 1e18;
for(int i = 0;i<n;i++){
for(int j = 0;j<m;j++){
mx1[i][j] = min(arr[i][j],(j?mx1[i][j-1]+1:inf));
}
}
for(int j = 0;j<m;j++){
for(int i = 0;i<n;i++){
mx1[i][j] = min(mx1[i][j],(i?mx1[i-1][j]+1:inf));
}
}
for(int i = 0;i<n;i++){
for(int j = m-1;j>=0;j--){
mx2[i][j] = min(arr[i][j],(j<(m-1)?mx2[i][j+1]+1:inf));
}
}
for(int j = m-1;j>=0;j--){
for(int i = 0;i<n;i++){
# | 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... |