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

Re:无限RT中。。求大牛帮忙

Posted by bjtu_huanglu at 2007-04-24 14:58:09 on Problem 2591
In Reply To:无限RT中。。求大牛帮忙 Posted by:wpolly at 2007-04-03 10:11:27
> #include<cstdio>
> long s[10000005];
> void main(){
> 	__int64 n,p2,p3,i,t,a,b;
> 	s[1]=p2=p3=t=1;
> 	while(scanf("%d",&n)==1){
> 		for(i=t+1;i<=n;i++){
> 			a=2*s[p2];b=3*s[p3];
> 			s[i]=((a>b)?b:a)+1;
> 			if(a>=b)p3++;if(b>=a)p2++;
> 		}
> 		t=n;
> 		printf("%d\n",s[n]);
> 	}
> }
> 
> 本机测试没有问题......为什么会RT呢?
long s[10000005];也太恐怖了吧

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