Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles, and they have periods of lengths 23, 28, and 33 days, respec…
POJ 1006 生理周期 分析:中国剩余定理(注意结果要大于d即可) 代码: #include<iostream> #include<cstdio> using namespace std; int n1, n2, n3, n; void solve() { n1 = *; != ) n1 += *; n2 = *; != ) n2 += *; n3 = *; != ) n3 += *; n = **; } int main() { ; solve(); ) { int p, e…
POJ.1006 Biorhythms (拓展欧几里得+中国剩余定理) 题意分析 不妨设日期为x,根据题意可以列出日期上的方程: 化简可得: 根据中国剩余定理求解即可. 代码总览 #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; typedef int ll; ll p,e,i,d; void exgcd(ll a,…
B - Biorhythms Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1006 Description 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这天,人会在相应的方面表现出色.例如,智力周期的高峰,人会思维敏捷,精力容易高度集中.因为三个周期的周长…
题目地址:POJ 1006 学习了下中国剩余定理.參考的该博客.博客戳这里. 中国剩余定理的求解方法: 假如说x%c1=m1,x%c2=m2,x%c3=m3.那么能够设三个数R1,R2,R3.R1为c2,c3的公倍数且余c1为1,同理.R2,R3也是如此.然后设z=R1*m1+R2*m2+R3*m3,那么z就是当中一个解.并且每隔(c1,c2,c3)的最小公倍数就是一个解.想要最小解的话,仅仅需对最小公倍数取余即可了. 以下的代码未删改.比赛的时候为了避免超时,R1,R2,R3的求解过程全然没有…
转载请注明出处:http://exp-blog.com/2018/06/24/pid-1054/ #include <iostream> #include <cstdio> using namespace std; int main() { ; while (scanf("%d %d %d %d",&p,&e,&i,&d)) { &&e==-&&i==-&&d==-)//记得出口!!…
    Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 107569   Accepted: 33365 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physi…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…
http://poj.org/problem?id=1006 题目大意: 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这天,人会在相应的方面表现出色.例如,智力周期的高峰,人会思维敏捷,精力容易高度集中.因为三个周期的周长不同,所以通常三个周期的高峰不会落在同一天.对于每个人,我们想知道何时三个高峰落在同一天.对于每个周期,我们会给出从当前年份的第一天开始,到出现高峰的天数(不一定是第一次高峰出现的时间).你的任务是…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 111285   Accepted: 34638 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…