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

无限RT中。。求大牛帮忙

Posted by wpolly at 2007-04-03 10:11:27 on Problem 2591
#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呢?

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