Submission #1100237

#TimeUsernameProblemLanguageResultExecution timeMemory
1100237vjudge1Maxcomp (info1cup18_maxcomp)C++98
60 / 100
1071 ms78988 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n, m; cin >> n >> m; int a[3000][3000]; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { cin >> a[i][j]; } } int mx = -INT_MAX; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { for(int r = 1; r <= n; r++) { for(int k = 1; k <= m; k++) { mx = max(mx, a[i][j] - a[r][k] - abs(i - r) - abs(j - k) - 1); } } } } cout << mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...