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

郁闷!为何WA,知道的发站内邮件给我,谢谢

Posted by jordankan at 2008-07-09 15:56:13 on Problem 3619
main(){
     long int n,k;
	 long int speed,readT,restT;
	 
	 long int i,j,h;
	 long int time=0;
	 scanf("%ld%ld",&n,&k);
	 h=n;
     for(i=1;i<=k;i++){
	     scanf("%ld%ld%ld",&speed,&readT,&restT);
         while(n!=0){
			 if(speed*readT>=n){  
				 time=time+n/speed; 
				 if(n/speed==0) time++; 
				 n=0;}
			 else{  time=time+readT+restT; n=n-speed*readT;}
		 }
         n=h;
		 
		 printf("%ld\n",time);
		 time=0;
	 }
}

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