# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
53943 | MatheusLealV | 여행하는 상인 (APIO17_merchant) | C++17 | 102 ms | 2552 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define N 105
#define M 1005
#define inf 1000000000000000000
using namespace std;
typedef long long ll;
int n, m, k;
ll opt[N][N], B[N][M], S[N][M], dist[N][N], dp[N][N];
inline bool check(ll x)
{
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= n; j++)
if(dist[i][j] == inf) dp[i][j] = inf;
else dp[i][j] = x*dist[i][j] - opt[i][j];
}
for(int k = 1; k <= n; k++)
for(int i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
for(int i = 1; i <= n; i++) if(dp[i][i] <= 0) return true;
return false;
}
# | 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... |