POJ 1006 Biorhythms
来源:互联网 发布:淘宝美工应聘流程 编辑:程序博客网 时间:2024/06/05 06:44
一道纯数学问题,难度和代码无关。简单说说:
设所求时间为x,则有x=x1*23+p=x2*28+e=x3*33+i。
写成同余式即为:
x % 23 = p
x % 28 = e
x % 33 = i
然后你可以百度“中国剩余定理”
我为什么不贴连接?骚年,你没等过几个小时的审查吧。
想当初,年轻的我以前居然往博文里放超链接,唉!
//PKU_1006//中国剩余定理,纯数学题#include <iostream>using namespace std;int main() {int x,y,z,d,i=0,n;while (cin>>x>>y>>z>>d && (x!=-1 || y!=-1 || z!=-1 || d!=-1)) {i++;n=(x*5544+y*14421+z*1288)%21252-d;if (n<=0)n+=21252;cout<<"Case "<<i<<": the next triple peak occurs in "<<n<<" days."<<endl;}return 0;}
0 0
- poj 1006 Biorhythms
- poj 1006 Biorhythms
- poj 1006 Biorhythms
- POJ 1006 Biorhythms
- POJ 1006 Biorhythms
- POJ 1006 Biorhythms
- 【POJ】1006 Biorhythms
- POJ-1006:Biorhythms
- POJ 1006 Biorhythms
- POJ 1006 Biorhythms
- POJ 1006 Biorhythms
- poj 1006 Biorhythms
- POJ 1006 Biorhythms
- Poj 1006 Biorhythms
- POJ 1006 Biorhythms
- poj 1006 hdu1370 Biorhythms
- 【POJ】1006 Biorhythms
- poj 1006 Biorhythms
- Your build settings specify a provisioning profile with the UUID‘XXX
- Unity原厂讲师对Unity内部技术讲解大揭秘
- 用Fiddler在Android上抓HTTPS包
- 使用Oracle自带的系统包和过程监控其它会话SQL语句的执行计划等信息
- 基于SocketChannel的即时聊天程序
- POJ 1006 Biorhythms
- utunbu启动进入文本界
- uva725 - Division
- android-Preparing Your In-app Billing Application,Establishing In-app Billing Products for Sale
- 摒弃以往的工作方法
- ubuntu上面装matlab
- 03-lvs-persistence
- Unity问答第3期
- uva673-栈-(字符读取和清空缓冲区)