Submission #1109956

#TimeUsernameProblemLanguageResultExecution timeMemory
1109956IrateMaxcomp (info1cup18_maxcomp)C++17
60 / 100
9 ms1104 KiB
#include<bits/stdc++.h> using namespace std; const int mxN = 55; int grid[mxN][mxN]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; for(int i = 0;i < n;++i){ for(int j = 0;j < m;++j){ cin >> grid[i][j]; } } int mx = -1e9; for(int i = 0;i < n;++i){ for(int j = 0;j < m;++j){ for(int ii = 0;ii < n;++ii){ for(int jj = 0;jj < m;++jj){ mx = max(mx, abs(grid[ii][jj] - grid[i][j]) - abs(ii - i) - abs(jj - j)); } } } } cout << mx - 1 << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...