标签:
Description
Input
Output
Sample Input
0 0 0 0 0 0 0 100 5 20 34 325 4 5 6 7 283 102 23 320 203 301 203 40 -1 -1 -1 -1
Sample Output
Case 1: the next triple peak occurs in 21252 days. Case 2: the next triple peak occurs in 21152 days. Case 3: the next triple peak occurs in 19575 days. Case 4: the next triple peak occurs in 16994 days. Case 5: the next triple peak occurs in 8910 days. Case 6: the next triple peak occurs in 10789 days.
详细解析:你想知道怎么做么,点我啊
#include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <algorithm> #include <set> #include <queue> #include <stack> #include <map> using namespace std; typedef long long LL; const int inf=0x3f3f3f3f; const double pi= acos(-1.0); #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 int main() { int icase=1; int p,e,i,d; int lmc; int res; while(~scanf("%d %d %d %d",&p,&e,&i,&d)){ if(p==-1&&e==-1&&i==-1&&d==-1) break; lmc=23*28*33; res=(5544*p+14421*e+1288*i-d+lmc)%lmc; if(res==0) res=lmc; printf("Case %d: the next triple peak occurs in %d days.\n",icase++,res); } return 0; }
标签:
原文地址:http://blog.csdn.net/u013486414/article/details/45422035