Submission #523713

#TimeUsernameProblemLanguageResultExecution timeMemory
523713maks007Maxcomp (info1cup18_maxcomp)C++14
15 / 100
2 ms204 KiB
#include <bits/stdc++.h> using namespace std; int dis(pair <int,int>a, pair <int,int> b) { return abs(a.first - b.first) + abs(a.second - b.second); } int main(void) { int n, m; cin >> n >> m; vector <vector <int> > g(n, vector <int> (m)); for(int i = 0; i < n; i ++) { for(int j = 0; j < m; j ++) cin >> g[i][j]; } int ans = 0; for(int i = 0; i < n; i ++) { for(int j = 0; j < m; j ++) { for(int k = 0; k < n; k ++) { for(int l = 0; l < m; l ++) { ans = max(ans, g[i][j] - g[k][l] - dis({i, j}, {k, l}) - 1); } } } } cout << ans; return false; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...