Submission #684735

# Submission time Handle Problem Language Result Execution time Memory
684735 2023-01-22T12:05:36 Z heeheeheehaaw Maxcomp (info1cup18_maxcomp) C++17
0 / 100
2 ms 212 KB
#include <iostream>
#define int long long

using namespace std;

int a[1005][1005];

int dist(int x1, int y1, int x2, int y2)
{
    return abs(x1 - x2) + abs(y1 - y2);
}

signed main()
{
    int n, m;
    cin>>n>>m;
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= m; j++)
            cin>>a[i][j];

    int maxx = -1;
    for(int i1 = 1; i1 <= n; i1++)
    {
        for(int j1 = 1; j1 <= m; j1++)
        {
            for(int i2 = 1; i2 <= n; i2++)
            {
                for(int j2 = 1; j2 <= m; j2++)
                {
                    if(i1 != j1 || i2 != j2)
                        maxx = max(maxx, a[i2][j2] - a[i1][j1] - dist(i1, j1, i2, j2));
                }
            }
        }
    }
    cout<<maxx<<'\n';
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -