#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    //freopen("acm.acm","r",stdin);
    int p;
    int e;
    int i;
    int d;
    int j;
    j = 0;
    while(cin>>p>>e>>i>>d)
    {
        if(p == -1&& e == -1 && i == -1 && d == -1)
            break;
        e = (5544*p + 14421*e + 1288*i - d)%(21252);
        while(e <= 0)
        {
            e += 21252;
        }
        cout<<"Case "<<++j<<": the next triple peak occurs in "<<e<<" days."<<endl;
    }
}

关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。

技术网站地址: vmfor.com

POJ 1006的更多相关文章

  1. POJ 1006 - Biorhythms (中国剩余定理)

    B - Biorhythms Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Subm ...

  2. POJ 1006 Biorhythms(中国剩余定理)

    题目地址:POJ 1006 学习了下中国剩余定理.參考的该博客.博客戳这里. 中国剩余定理的求解方法: 假如说x%c1=m1,x%c2=m2,x%c3=m3.那么能够设三个数R1,R2,R3.R1为c ...

  3. POJ 1006 生理周期(中国剩余定理)

    POJ 1006 生理周期 分析:中国剩余定理(注意结果要大于d即可) 代码: #include<iostream> #include<cstdio> using namesp ...

  4. POJ.1006 Biorhythms (拓展欧几里得+中国剩余定理)

    POJ.1006 Biorhythms (拓展欧几里得+中国剩余定理) 题意分析 不妨设日期为x,根据题意可以列出日期上的方程: 化简可得: 根据中国剩余定理求解即可. 代码总览 #include & ...

  5. Poj 1006 / OpenJudge 2977 1006 Biorhythms/生理周期

    1.链接地址: http://poj.org/problem?id=1006 http://bailian.openjudge.cn/practice/2977 2.题目: Biorhythms Ti ...

  6. 【中国剩余定理】POJ 1006 & HDU 1370 Biorhythms

    题目链接: http://poj.org/problem?id=1006 http://acm.hdu.edu.cn/showproblem.php?pid=1370 题目大意: (X+d)%23=a ...

  7. 中国剩余定理 (POJ 1006)

    http://poj.org/problem?id=1006      在<孙子算经>中有这样一个问题:“今有物不知其数,三三数之剩二(除以3余2),五五数之剩三(除以5余3),七七数之剩 ...

  8. POJ 1006 Biorhythnms(中国剩余定理)

    http://poj.org/problem?id=1006 题意: (n+d) % 23 = p ;(n+d) % 28 = e ;(n+d) % 33 = i ; 求最小的n. 思路: 这道题就是 ...

  9. poj 1006 Biorhythms (中国剩余定理模板)

    http://poj.org/problem?id=1006 题目大意: 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这 ...

  10. 生理周期,POJ(1006)

    题目链接:http://poj.org/problem?id=1006 解题报告: 1.枚举天数的时候可以根据前面的结果直接跳过一些错误的答案. ///三个周期是23,28,33, #include ...

随机推荐

  1. 2018.09.07 Amount of degrees(数位dp)

    描述 求给定区间[X,Y]中满足下列条件的整数个数:这个数恰好等于K个互不相等的B的整数次幂之和. 例如,设X=15,Y=20,K=2,B=2,则有且仅有下列三个数满足题意: 17 = 24+20, ...

  2. Cygwin工具的简单使用

    简介 从使用角度来看:Cygwin就是一个windows软件,该软件就是在windows上仿真linux操作系统.简言之,cygwin是一个在windows平台上运行的 linux模拟环境,使用一个D ...

  3. 解决Error creating bean with name 'huayuanjingguanDaoimp' defined in file [D:\apache-tomcat-7.0.52\webapps\landscapings\WEB-INF\classes\com\itheima\landscaping\dao\imp\huayuanjingguanDaoimp.class]: Invo

    问题描述: 10:23:13,585 ERROR ContextLoader:307 - Context initialization failedorg.springframework.beans. ...

  4. hdu 2086 A1 = ?(数学题)

    转载链接 因为:Ai=(Ai-1+Ai+1)/2 - Ci,        A1=(A0  +A2  )/2 - C1;       A2=(A1  +  A3)/2 - C2 , ... => ...

  5. springmvc elf8848

    刚开始觉得孔浩讲得好,之后觉得开涛讲得好,现在觉得elf8848讲得好.其实只是自己学习的各个阶段 孔浩:环境搭建,做了个基础的CRUD 开涛:讲了Controller(不该看),注解,数据绑定,请求 ...

  6. 软件工程—WC功能实现 (JAVA)

    软件工程-WC功能实现(JAVA) Github项目地址:https://github.com/Ousyoung/wc 项目要求 ​ wc.exe 是一个常见的工具,它能统计文本文件的字符数.单词数和 ...

  7. Python学习-18.Python中的错误处理(三)

    在某些情况下,我们需要定义自己的异常并且抛出 先定义一个错误: class MyError(BaseException): def __init__(self): pass 上面定义了一个叫MyErr ...

  8. JQuery fullcalender文档

    转载: http://blog.csdn.net/lgg2011. 使用方式, 引入相关js, css后, $(‘#div_name’).fullCalendar({//options});  接受的 ...

  9. 初识powershell、nuget powershell 调试

    初识powershell.nuget powershell 调试 补充 此文仅当做powershell的初步认识体验,关于nuget包里此脚本的使用官方已在vs2017停止支持,请看此文文末 前言 老 ...

  10. sqlserver错误2,error 40

    打开配置管理器:开始-> sqlserver2014->配置工具->配置管理器 选择sqlserver服务,并将右侧箭头的指向右击设为启动就OK了