# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1171282 | Muhammet | Travelling Merchant (APIO17_merchant) | C++17 | 55 ms | 2120 KiB |
#include "bits/stdc++.h"
using namespace std;
#define ll long long
const int N = 1e2 + 5;
ll n, m, k, ans = 1e12 + 1;
vector <vector <ll>> dis, e, b, s, e1;
bool check(ll x1) {
e1 = e;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
e1[i][j] -= (x1 * dis[i][j]);
e1[i][j] *= (-1);
}
}
for(int x = 1; x <= n; x++) {
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
e1[i][j] = min(e1[i][j], e1[i][x] + e1[x][j]);
}
}
}
for(int i = 1; i <= n; i++) {
if(e1[i][i] <= 0) return true;
}
# | 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... |