UVa 10048 Audiophobia
2014-02-19 08:14
519 查看
Problem B: Audiophobia |
However, for the time being, we will consider only one type of pollution - the sound pollution. The loudness or intensity level of sound is usually measured in decibels and sound having intensity level 130 decibels or higher is considered painful. The intensity level of normal conversation is 6065 decibels and that of heavy traffic is 7080 decibels.
Consider the following city map where the edges refer to streets and the nodes refer to crossings. The integer on each edge is the average intensity level of sound (in decibels) in the corresponding street.
#include<iostream> #include<algorithm> #include<cstdio> #define INF 0x7fffffff using namespace std; int c,s,q; int Map[150][150]; int main() { int kase=0; while(scanf("%d %d %d",&c,&s,&q)==3&&(c||s||q)) { kase++; if(kase>1) puts(""); printf("Case #%d\n",kase); for(int i=1;i<=c;i++) for(int j=1;j<=c;j++) Map[i][j]=INF; int c1,c2,d; for(int i=1;i<=s;i++) { scanf("%d %d %d",&c1,&c2,&d); Map[c1][c2]=Map[c2][c1]=d; } for(int k=1;k<=c;k++) for(int i=1;i<=c;i++) for(int j=1;j<=c;j++) Map[i][j]=min(Map[i][j],max(Map[i][k],Map[k][j])); for(int i=1;i<=q;i++) { scanf("%d %d",&c1,&c2); if(Map[c1][c2]==INF) puts("no path"); else printf("%d\n",Map[c1][c2]); } } return 0; }
[C++]
相关文章推荐
- UVa:10048 Audiophobia
- UVA-10048 Audiophobia(最短路上的最小值,Folyd)
- UVa 10048 - Audiophobia 简单Floyd
- UVA10048 Audiophobia[Floyd变形]
- UVa 10048 Audiophobia 最短路的最大值
- UVA 10048 Audiophobia
- UVA - 10048 Audiophobia
- UVa10048_Audiophobia(最短路/floyd)(小白书图论专题)
- UVa 10048 Audiophobia(最短路&Floyd)
- UVA10048-Audiophobia-最短路
- UVA 10048 Audiophobia 最小生成树
- UVa10048 Audiophobia (Floyd)
- UVa 10048 Audiophobia
- uva 10048 Audiophobia
- UVA10048-Audiophobia
- uva10048 - Audiophobia
- uva 10048 Audiophobia(最小生成树)
- uva 10048 Audiophobia(最小生成树)
- UVa 10048: Audiophobia
- UVA 10048 Audiophobia