# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
374242 | ivan_tudor | Travelling Merchant (APIO17_merchant) | C++14 | 154 ms | 4332 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;
const long long N = 105;
long long mind[N][N];
long long maxp[N][N];
long long newc[N][N];
long long b[N][1005];
long long s[N][1005];
long long n;
bool check(long long R){
for(long long i =1 ; i<=n;i++)
for(long long j =1 ; j<=n;j++){
newc[i][j] = maxp[i][j] - R * mind[i][j];
}
for(long long k = 1; k <=n;k++){
for(long long i = 1; i<=n;i++)
for(long long j =1 ; j<=n;j++){
if(newc[i][k] + newc[k][j] > newc[i][j])
newc[i][j] = newc[i][k] + newc[k][j];
}
}
for(long long i =1 ; i<=n;i++){
if(newc[i][i] >=0)
return true;
}
return false;
}
int main()
{
# | 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... |