#include <stdio.h> using namespace std; int maps[1005][1005]; void init () { for (int i=0;i<=1000;i++) for (int j=0;j<=1000;j++) maps[i][j]=999999999; } int main() { int n,m,t; while (scanf ("%d%d%d",&n,&m,&t)!=EOF) { int s,e; init(); scanf ("%d%d",&s,&e); int i,a,b,c; for (i=0;i<m;i++) { scanf ("%d%d%d",&a,&b,&c); maps[a][b]=c; maps[b][a]=c; } for (i=1;i<=n;i++) { for (int j=1;j<=n;j++) { for (int k=1;k<=n;k++) { if (maps[i][k]+maps[k][j]<maps[i][j]) maps[i][j]=maps[i][k]+maps[k][j]; } } } if (maps[s][e]*10<=t) printf ("%d\n",maps[s][e]*10); else printf ("I am sorry,jlh!\n"); } return 0; } /* Main.c:3:1: error: unknown type name ‘using’ using namespace std; ^ Main.c:3:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘std’ using namespace std; ^ */ |
Double click to view unformatted code.