UVA756 Biorhythms

crt

crt裸题

因为模数已知所以有些值能直接求

#include<iostream>
#include<cstdio>
using namespace std;
typedef long long ll;
ll p,e,i,d,lcm=,ans,t;
int main(){
while(){
cin>>p>>e>>i>>d;
if(p==-) break;
ans=(*p+*e+*i-d+lcm)%lcm; //exgcd可以预先算
printf("Case %lld: the next triple peak occurs in %lld days.\n",++t,ans ? ans:lcm);
}return ;
}

UVA756 Biorhythms的更多相关文章

  1. 【题解】UVA756 Biorhythms (中国剩余定理)

    UVA756:https://www.luogu.org/problemnew/show/UVA756 思路 几乎是裸的中国剩余定理模板题 但是需要注意的是此题并不是求最小正整数解 而是求大于d的解 ...

  2. 中国剩余定理+扩展中国剩余定理 讲解+例题(HDU1370 Biorhythms + POJ2891 Strange Way to Express Integers)

    0.引子 每一个讲中国剩余定理的人,都会从孙子的一道例题讲起 有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二.问物几何? 1.中国剩余定理 引子里的例题实际上是求一个最小的x满足 关键是,其中 ...

  3. poj1006 / hdu1370 Biorhythms (中国剩余定理)

    Biorhythms 题意:读入p,e,i,d 4个整数,已知(n+d)%23=p;   (n+d)%28=e;   (n+d)%33=i ,求n .        (题在文末) 知识点:中国剩余定理 ...

  4. poj 1006:Biorhythms(水题,经典题,中国剩余定理)

    Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Des ...

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

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

  6. [POJ] #1006# Biorhythms : 最小公倍数/同余问题

    一. 题目 Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 127263   Accepted: 403 ...

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

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

  8. 算法练习之:Biorhythms

    Biorhythms Time Limit: 1000MS Memory Limit: 10000KB  Problem Description Some people believe that th ...

  9. Biorhythms(中国剩余定理)

    Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 127339   Accepted: 40342 Des ...

随机推荐

  1. 卸载重装ArcGIS Enterprise 注意事项

    ArcGIS Enterprise ,通俗的讲,即“ArcGIS Server 10.5+ 版本” 强烈建议参考文档: windows环境安装ArcGIS Enterprise ,http://zhi ...

  2. 【JMeter】1.9上考试jmeter测试调试

    1.打开抓包工具开始抓包,抓取录制脚本的整个过程.以方便后续确认关联参数的左右关联,搜索相关代码. 1.用badboy录制测试脚本并存为jmeter格式. 2.用jmeter打开已经保存的脚本 1.用 ...

  3. requests爬取百度贴吧:python 美女 3

    import requests import sys class Tieba(object): def __init__(self, tieba_name, pn): self.tieba_name ...

  4. 【查阅】mysql系统视图查看

    [1]查看表大小 SELECT CONCAT(table_schema,'.',table_name) AS 'Table Name', table_rows AS 'Number of Rows', ...

  5. golang 的精髓--pipeline流水线,对现实世界的完美模拟

    https://blog.golang.org/pipelines https://www.cnblogs.com/junneyang/p/6215785.html 简介 Go语言的并发原语允许开发者 ...

  6. python2与python3之间的主要区别

    python2与python3之间的主要区别 print py2:print语句,语句就意味着可以直接跟要打印的东西,如果后面接的是一个元组对象,直接打印 py3:print函数,函数就以为这必须要加 ...

  7. PAT 1017 Queueing at Bank[一般]

    1017 Queueing at Bank (25)(25 分)提问 Suppose a bank has K windows open for service. There is a yellow ...

  8. 阿里云安装docker 指定版本

    sh docker-install.sh 1.12.6 #ubuntu16.4 测试通过 #!/bin/sh set -e # # This script is meant for quick &am ...

  9. LeetCode Python 位操作 1

    Python 位操作: 按位与 &, 按位或 | 体会不到 按位异或 ^ num ^ num = 0 左移 << num << 1 == num * 2**1 右移 & ...

  10. 用python写http接口自动化测试框架

    本文是转载张元礼的博客 http://blog.csdn.Net/vincetest 一.测试需求描述 对服务后台一系列的http接口功能测试. 输入:根据接口描述构造不同的参数输入值 输出:XML文 ...