제출 #1174418

#제출 시각아이디문제언어결과실행 시간메모리
1174418PacybwoahMaxcomp (info1cup18_maxcomp)C++20
60 / 100
1093 ms8264 KiB
#include<iostream> #include<vector> #include<algorithm> #include<utility> #include<cmath> using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; vector<vector<ll>> vec(n + 1, vector<ll>(m + 1)); for(int i = 1; i <= n; i++) for(int j = 1; j <= m; j++) cin >> vec[i][j]; ll ans = 0; for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ for(int k = 1; k <= n; k++){ for(int l = 1; l <= m; l++){ ans = max(ans, llabs(vec[i][j] - vec[k][l]) - llabs(i - k) - llabs(j - l)); } } } } cout << ans - 1 << "\n"; } // g++ -std=c++17 -Wall -Wextra -Wshadow -fsanitize=undefined -fsanitize=address -o run pA.cpp -g
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...