제출 #103983

#제출 시각아이디문제언어결과실행 시간메모리
103983autumn_eel여행하는 상인 (APIO17_merchant)C++14
12 / 100
47 ms3320 KiB
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef long long ll; int d[200][200]; int b[200][2000],s[200][2000]; int main(){ int n,m,K;cin>>n>>m>>K; rep(i,n)rep(j,K)scanf("%d%d",&b[i][j],&s[i][j]); memset(d,0x3f,sizeof(d)); rep(i,n)d[i][i]=0; rep(i,m){ int a,b,c;scanf("%d%d%d",&a,&b,&c);a--;b--; d[a][b]=c; } rep(k,n)rep(i,n)rep(j,n){ d[i][j]=min(d[i][j],d[i][k]+d[k][j]); } int Max=0; for(int i=1;i<n;i++){ rep(j,K){ if(b[0][j]==-1||s[i][j]==-1)continue; Max=max(Max,(s[i][j]-b[0][j])/(d[0][i]+d[i][0])); } } cout<<Max<<endl; }

컴파일 시 표준 에러 (stderr) 메시지

merchant.cpp: In function 'int main()':
merchant.cpp:11:23: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  rep(i,n)rep(j,K)scanf("%d%d",&b[i][j],&s[i][j]);
                  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
merchant.cpp:15:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int a,b,c;scanf("%d%d%d",&a,&b,&c);a--;b--;
             ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...