이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
int main()
{
int n, m;
std::cin >> n >> m;
std::vector<int> A[n];
for (int i = 0; i < n; ++i)
for (int j = 0; j < m; ++j)
{
int k;
std::cin >> k;
A[i].push_back(k);
}
int S = -1;
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < m; ++j)
{
for (int k = 0; k < n; ++k)
{
for (int w = 0; w < m; ++w)
{
//std::cout << std::max(A[i][j], A[k][w])-std::min(A[i][j], A[k][w])-(std::abs(i-k)+std::abs(j-w)+1) << " ";
S = std::max(S, std::max(A[i][j], A[k][w])-std::min(A[i][j], A[k][w])-(std::abs(i-k)+std::abs(j-w)+1));
}
}
}
}
std::cout << "\n" << S << "\n";
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |