| ||||||||||
| 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 | |||||||||
续同样的程序不一样的结果?原来GCC时间快这么多?377MS 和900多MS GCC VS C?In Reply To:同样的程序 不一样的结果?WHY? Posted by:heiheigo at 2005-07-10 11:26:35 Source
Problem Id:1006 User Id:heiheigo
Memory:32K Time:377MS
Language:GCC Result:Accepted
Source
#include "stdio.h"
int main(){
int p,e,i,d;
int j=1;
int k=1;
long r;
while(scanf("%d%d%d%d",&p,&e,&i,&d)){
if(p==-1)
break;
while(1){
if((k-p)%23==0&&(k-e)%28==0&&(k-i)%33==0){
k=k-d;
if(k<=0)
k+=21252;
break;
}
k++;
}
printf("Case %d: the next triple peak occurs in %ld days.\n", j, k);
j++;
k=1;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator