| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
童鞋们注意输入啊!!!!!WA了好几次才发现。。。QAQ
一开始我直接分 M 和 W 输入,一直WA,
后来判断了一下再输就A了
for(i=1;i<=m;i++)
{
scanf("%d%d%d",&a,&b,&c);
if (map[a][b])
map[a][b]=min(map[a][b],c);
else map[a][b]=c;
if (map[b][a])
map[b][a]=min(map[b][a],c);
else map[b][a]=c;
}
for(i=1;i<=w;i++)
{
scanf("%d%d%d",&a,&b,&c);
if (map[a][b])
map[a][b]=min(map[a][b],-c);
else map[a][b]=-c;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator