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 ACM06021fly at 2006-09-17 01:14:03 on Problem 2992
In Reply To:TLE的程序 Posted by:mixter at 2006-09-16 18:33:46
> __int64  factpow(int n,int p)
> {   
> 	if(ans[n][p]!=-1) return ans[n][p];
> 	__int64 d=0;
> 	do
> 	{
> 		n /= p;         // n值怎么能改变呢?
> 		d += n;
> 	}while(n);
>     ans[n][p]=d;                // 这儿要用。
> 	return d;
> }

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