# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
77955 | aquablitz11 | Travelling Merchant (APIO17_merchant) | C++14 | 122 ms | 9500 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>
using namespace std;
using ll = long long;
const int N = 110;
const int T = 1010;
const ll INF = 1e18;
int n, m, t;
int B[N][T], S[N][T];
ll pro[N][N], dist[N][N], A[N][N];
bool check(ll r)
{
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j)
A[i][j] = pro[i][j]-dist[i][j]*r;
A[i][i] = -INF;
}
for (int k = 1; k <= n; ++k) {
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j)
A[i][j] = max(A[i][j], A[i][k]+A[k][j]);
}
}
/*printf("check(%lld):\n", r);
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= n; ++j)
printf("%lld ", A[i][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... |