POJ 1006
#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的更多相关文章
- POJ 1006 - Biorhythms (中国剩余定理)
B - Biorhythms Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Subm ...
- POJ 1006 Biorhythms(中国剩余定理)
题目地址:POJ 1006 学习了下中国剩余定理.參考的该博客.博客戳这里. 中国剩余定理的求解方法: 假如说x%c1=m1,x%c2=m2,x%c3=m3.那么能够设三个数R1,R2,R3.R1为c ...
- POJ 1006 生理周期(中国剩余定理)
POJ 1006 生理周期 分析:中国剩余定理(注意结果要大于d即可) 代码: #include<iostream> #include<cstdio> using namesp ...
- POJ.1006 Biorhythms (拓展欧几里得+中国剩余定理)
POJ.1006 Biorhythms (拓展欧几里得+中国剩余定理) 题意分析 不妨设日期为x,根据题意可以列出日期上的方程: 化简可得: 根据中国剩余定理求解即可. 代码总览 #include & ...
- Poj 1006 / OpenJudge 2977 1006 Biorhythms/生理周期
1.链接地址: http://poj.org/problem?id=1006 http://bailian.openjudge.cn/practice/2977 2.题目: Biorhythms Ti ...
- 【中国剩余定理】POJ 1006 & HDU 1370 Biorhythms
题目链接: http://poj.org/problem?id=1006 http://acm.hdu.edu.cn/showproblem.php?pid=1370 题目大意: (X+d)%23=a ...
- 中国剩余定理 (POJ 1006)
http://poj.org/problem?id=1006 在<孙子算经>中有这样一个问题:“今有物不知其数,三三数之剩二(除以3余2),五五数之剩三(除以5余3),七七数之剩 ...
- POJ 1006 Biorhythnms(中国剩余定理)
http://poj.org/problem?id=1006 题意: (n+d) % 23 = p ;(n+d) % 28 = e ;(n+d) % 33 = i ; 求最小的n. 思路: 这道题就是 ...
- poj 1006 Biorhythms (中国剩余定理模板)
http://poj.org/problem?id=1006 题目大意: 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这 ...
- 生理周期,POJ(1006)
题目链接:http://poj.org/problem?id=1006 解题报告: 1.枚举天数的时候可以根据前面的结果直接跳过一些错误的答案. ///三个周期是23,28,33, #include ...
随机推荐
- mysql实现分页的几种方式
mysql实现分页的几种方式: 第一种:使用框架自带的pageable来进行分页 package com.cellstrain.icell.repository.repositoryImpl; imp ...
- 2018.08.15 bzoj3747: [POI2015]Kinoman(线段树)
传送门 简单题. 先不管时间复杂度看看怎么做. 对于一段区间[l,r],如果从右端加入一个数a[r+1],对这个区间有什么影响?显然如果区间中已经有了a[r+1]这个数就会产生-a[i+1]的影响,否 ...
- hdu-1143(简单dp)
题目链接: 思路:利用前一个状态找到本次状态需要的次数,就是递推. 建立一个二维数组dp[i][j] ,i表示行,j表示多余的格子. 可以分为三种状态dp[i][0], dp[i][1] ,dp[i] ...
- 第八章 连词(Les conjonction )
★并列连词(La conjonction de coordination ) ()表示联合关系的并列连词 .et连接肯定的内容.如: ➞Il conduit vite et bien. ...
- arduino空调遥控器
参考:http://www.arduino.cn/thread-3487-1-1.html http://www.arduino.cn/thread-3618-1-1.html 注意1:有金属外壳的一 ...
- js函数预编译
function fn(a){ console.log(a); var a = 123; function a(){} console.log(a); var b = function(){} con ...
- What Is Your Grade?
Problem Description “Point, point, life of student!”This is a ballad(歌谣)well known in colleges, and ...
- JProfiler 简要使用说明
1.简介 JProfiler是一个ALL-IN-ONE的JAVA剖析工具,可以方便地监控Java程序的CPU.内存使用状况,能够检查垃圾回收.分析性能瓶颈. 本说明文档基于JProfiler 9.2编 ...
- [翻译] FastReport 格式化和突出显示
一:格式化一个值 聚合函数的一个特征是,返回的数值没有格式化,如如下例子所示,它使用"SUM": 数据字段通常返回一个格式化的值,这是一个没有任何变化的"文本" ...
- 读《深入理解Windows Phone 8.1 UI控件编程》1.4.3 框架的应用示例:自定义弹出窗口有感
前些天买了园子里林政老师的两本 WP8.1 的书籍.毕竟想要学得深入的话,还是得弄本书跟着前辈走的. 今天读到 1.4.3 节——框架的应用示例:自定义弹出窗口这一小节.总的来说,就是弄一个像 Mes ...