| ||||||||||
| 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 | |||||||||
n=0和n=1的数据太BT了。。 唉,spfa跑了2700ms。。汗死。。n=0和n=1的数据太BT了。。
n=0和n=1时试着这样处理。。
scanf("%I64d%I64d",&N,&M);
if(N==0)
{
for(i=1;i<=M;i++) scanf("%I64d%I64d%I64d",&a,&b,&w);
printf("0\n");continue;
}
if(N==1)
{
scanf("%I64d",&t);
for(i=1;i<=M;i++) scanf("%I64d%I64d%I64d",&a,&b,&w);
printf("0\n");continue;
}
唉,spfa跑了2700ms。。汗死。。
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator