Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

n=0和n=1的数据太BT了。。 唉,spfa跑了2700ms。。汗死。。

Posted by joy_w at 2009-10-08 14:34:17 on Problem 3013
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator