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

讨论,,,是对还是错,,不是我的方法,,

Posted by deep_you at 2005-02-27 22:25:30 on Problem 1006
> 1006题听我们同学说有数学方法,,如下
> #include <stdio.h>
> int main(void){
>    int p, e, i, d;
>    int c=1;
>    long int triple = 0;
>    scanf("%d%d%d%d", &p, &e, &i, &d);
>    while(p!=-1){
>       triple = (p*5544+e*14421+i*1288)%21252;
>       triple-=d;
>       if(triple <= 0)
> 				triple+=21252;
>       printf("Case %d: the next triple peak occurs in %ld days.\n", c++, triple);
>       scanf("%d%d%d%d", &p, &e, &i, &d);
>    }
> }
> 
> 我试了,发现给的测试数据中后面几个都通过不了,但是却可以AC,疑惑中....

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