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:我的SAMPLE也是对的,可是提交了就是WRONG ANSWER,各位帮帮忙啊,谢谢了!!

Posted by arcane at 2005-06-10 16:01:32 on Problem 1006
In Reply To:我的SAMPLE也是对的,可是提交了就是WRONG ANSWER,各位帮帮忙啊,谢谢了!! Posted by:happy5630 at 2005-05-15 13:10:30
你这样有可能得到负的,而且速度也慢吧
> #include <iostream>
> using namespace std;
> int main()
> { long p,e,i,d;
>   long a;
>   long number=1;
>   while(cin>>p>>e>>i>>d){
> 	  if(p==-1 && e==-1 && i==-1 && d==-1) break;
> 	  for(a=1;;a++){
> 		  if((a-p)%23==0 && (a-e)%28==0 && (a-i)%33==0){
> 			  cout<<"Case "<<number<<": the next triple peak occurs in "<<a-d+1<<" days."<<endl;
> 			  number++;
> 		      break;
> 		  }
> 	  }
>   }
>   return 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