# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
750328 | boris_7 | Travelling Merchant (APIO17_merchant) | C++17 | 170 ms | 2432 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;
int main(){
int n,m,k;
cin>>n>>m>>k;
vector<vector<ll>>b(n,vector<ll>(k)),s(n,vector<ll>(k));
for(int i = 0;i<n;i++){
for(int j = 0;j<k;j++){
cin>>b[i][j]>>s[i][j];
}
}
vector<vector<pair<ll,ll>>>gp(n);
vector<vector<ll>>d(n,vector<ll>(n,1e18));
for(int i = 0;i<m;i++){
int u,v,w;
cin>>u>>v>>w;
gp[--u].push_back({--v,w});
d[u][v]=w;
}
for(int p = 0;p<n;p++){
for(int i = 0;i<n;i++){
for(int j = 0;j<n;j++){
d[i][j] = min(d[i][j],d[i][p]+d[p][j]);
}
}
}
vector<vector<ll>>max_delta(n,vector<ll>(n));
for(int p = 0;p<k;p++){
# | 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... |