Submission #765303

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7653032023-06-24 10:34:52Ahmed57Maxcomp (info1cup18_maxcomp)C++17
100 / 100
112 ms68092 KiB
#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++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...