| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:我的SAMPLE也是对的,可是提交了就是WRONG ANSWER,各位帮帮忙啊,谢谢了!!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator