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

自己改了改,试了试,还是运算问题?奇怪了。

Posted by alpc62 at 2007-09-23 17:15:24 on Problem 3385
In Reply To:IO吧,不知怎么的mingw的IO就是慢…… Posted by:frkstyc at 2007-09-23 15:44:46
2S时限,原先G++ TLE而C++ 225MS AC:
for (res=i=0;i<=n;i++)
	if (a[i]>d)	res+=(a[i]-2)/(d-1);

改成下面这样 G++ 991MS AC:
for (res=i=0;i<=n;i++)
{
	if (a[i]<=d)	continue;
	res+=(a[i]-2)/(d-1);
}

真奇怪!!continue在G++能够使if加速一倍?

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