Submission #1100233

#TimeUsernameProblemLanguageResultExecution timeMemory
1100233vjudge1Maxcomp (info1cup18_maxcomp)C++98
0 / 100
1 ms504 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n, m; cin >> n >> m; int a[n][m]; 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...