# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1142708 | Kerim | Maxcomp (info1cup18_maxcomp) | C++20 | 1095 ms | 8264 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sz size()
#define ff first
#define ss second
#define pb push_back
#define pii pair <int, int>
#define dur exit(0)
#define dur1 return(0)
const int N = 1e3 + 5;
ll n, m, a[N][N], jog = -1;
int main () {
// freopen ("input.txt", "r", stdin);
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> n >> m;
for (ll i = 1; i <= n; ++i) {
for (ll j = 1; j <= m; ++j) {
cin >> a[i][j];
}
}
for (ll i = 1; i <= n; ++i) {
for (ll j = 1; j <= m; ++j) {
for (ll l = 1; l <= n; ++l) {
for (ll r = 1; r <= m; ++r) {
ll cost = abs (a[l][r] - a[i][j]);
ll cost1 = abs (i - l) + abs (r - j) + 1;
jog = max (jog, cost - cost1);
// if (jog == 3) {
// cout << i << " " << j << " " << l << " " << r << "\n";
# | 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... |