# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230028 | MetB | Travelling Merchant (APIO17_merchant) | C++14 | 256 ms | 2552 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define N 1000003
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INF = 1e17, MOD = INF + 7, MOD2 = 1e6 + 3;
ll un_dist[100][100], deal[100][100];
ll sell[100][100], buy[100][100], n, m, k;
ll d[100][100];
bool check (int x) {
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++) {
if (un_dist[i][j] == INF) d[i][j] = -INF;
else d[i][j] = deal[i][j] - x * un_dist[i][j];
}
for (int k = 0; k < n; k++)
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (d[i][j] < d[i][k] + d[k][j]) d[i][j] = d[i][k] + d[k][j];
Compilation message (stderr)
# | 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... |