# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57338 | joaogui1 | Travelling Merchant (APIO17_merchant) | C++14 | 184 ms | 2588 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>
#define ff first
#define ss second
#define INF (1LL << 57)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pii;
int n;
bool reach[128][128];
pii itens[128][1024];
ll g[128][128], dist[128][128], profit[128][128];
void fw(){
for(int k = 1; k <= n; ++k)
for(int i = 1; i <= n; ++i)
for(int j = 1; j <= n; ++j){
g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
reach[i][j] |= (reach[i][k] && reach[k][j]);
}
}
bool fw(ll r){
for(int i = 1; i <= n; ++i)
for(int j = 1; j <= n; ++j)
if(reach[i][j])
dist[i][j] = r*g[i][j] - profit[i][j];
# | 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... |