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 0715110 at 2009-04-27 22:21:33 on Problem 1006
#include"stdio.h"
void main()
{int p[1000],e[1000],i[1000],d[1000],s;
 int j,k,n,m;
 scanf("%d",&n);
 for(j=0;j<n;j++)
 scanf("%d %d %d %d",&p[j],&e[j],&i[j],&d[j]);
for(j=0;j<n;j++)
{if(p[j]>=0&&e[j]>=0&&i[j]>=0&&d[j]>=0)

{for(k=1;;k++)
  {s=p[j]+23*k; 
   if((s-e[j])%28==0&&(s-i[j])%33==0) 
	   break;
  }
m=s-d[j];
if (m>23*28*33) m=m-23*28*33;
printf("Case %d : the next triple peak occurs in %d days.\n",j+1,m);
}
}
}

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