| ||||||||||
| 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 | |||||||||
1006在VC上测试答案都对的,但就是不能AC,我新手,望大家多多帮忙#include<iostream>
int main()
{ using namespace std;
int p,e,i,d,n[1000],j;
j=1;
p=0;
while (p!=-1)
{
cin>>p>>e>>i>>d;
for(int k=1;k<21253;k++)
if ((k+d-p)%23==0 &&(k+d-e)%28 ==0 &&(k+d-i)%33==0 )
{
n[j]=k;
j=j+1;
};
};
for(int z=1;z<j-1;z++)
cout<<"Case "<<z<<": the next triple peak occurs in "<<n[z]<<" days."<<endl;
return 0;
}
我先用n[100],出来的是RUNTIME ERROR ,再改成n[1000]后,出来的是Time Limit Exceed 。怎么改才可以?
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator