제출 #744409

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7444092023-05-18 14:27:38Mauve여행하는 상인 (APIO17_merchant)C++14
45 / 100
79 ms2112 KiB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ss second
#define ff first
#define INF 4000000000000000000
#define pb push_back
ll n,m,l,r,i,j,ii,jj,k,x,y,T,s,e,adj[101][101],ashig[101][101],adj1[101][101],buy[101][1001],sell[101][1001];
bool floyd_warshall(ll graph[101][101]){
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
for(int k=1;k<=n;k++)
graph[j][k]=min(graph[j][k],graph[j][i]+graph[i][k]);
for(int i=1;i<=n;i++) if(graph[i][i]<=0) return true;
return false;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>n>>m>>k;
for(i=1;i<=n;i++)
for(j=1;j<=k;j++)
cin>>buy[i][j]>>sell[i][j];
for(i=1;i<=n;i++) for(j=1;j<=n;j++) adj[i][j]=INF;
for(i=1;i<=m;i++){
cin>>l>>r>>e;
adj[l][r]=e;
}
floyd_warshall(adj);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...