题目:http://poj.org/problem?id=1006 用扩展欧几里得算法求逆元,使用中国剩余定理; 本题较简单,可以手算直接写出,不过我仍使用了模板。 代码如下: ...
分类:
其他好文 时间:
2018-01-05 19:10:06
阅读次数:
104
github: git.oschina.net/hocriser/templates (gitee.com/hocriser/templates) 斜率优化 https://www.cnblogs.com/ka200812/archive/2012/08/03/2621345.html 中国剩余定理 ...
分类:
其他好文 时间:
2018-01-02 18:50:39
阅读次数:
155
中国剩余定理(孙子定理)详解 原文:https://www.cnblogs.com/freinds/p/6388992.html 问题:今有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二。问物几何? 说明白一点就是说,存在一个数x,除以3余2,除以5余三,除以7余二,然后求这个数。上面给出了解 ...
分类:
其他好文 时间:
2017-12-26 14:17:24
阅读次数:
154
When ?? was born, seven crows flew in and stopped beside him. In its childhood, ?? had been unfortunately fall into the sea. While it was dying, seven ...
分类:
其他好文 时间:
2017-12-17 23:41:29
阅读次数:
152
One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六 ...
分类:
其他好文 时间:
2017-12-17 11:06:01
阅读次数:
229
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, emotiona ...
分类:
其他好文 时间:
2017-12-16 21:12:59
阅读次数:
161
On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave becaus ...
分类:
其他好文 时间:
2017-12-16 18:32:53
阅读次数:
145
题链: http://www.lydsy.com/JudgeOnline/problem.php?id=3129 题解: 容斥,扩展Lucas,中国剩余定理 先看看不管限制,只需要每个位置都是正整数时的方案数的求法。假设有 N 个未知数,加起来的和为 M。转化一下问题变为:"小球分配" 有 M 个相... ...
分类:
其他好文 时间:
2017-12-14 22:09:26
阅读次数:
167
题目: 人自出生起就有体力,情感和智力三个生理周期,分别为23,28和33天。一个周期内有一天为峰值,在这一天,人在对应的方面(体力,情感或智力)表现最好。 通常这三个周期的峰值不会是同一天。现在给出三个日期,分别对应于体力,情感,智力出现峰值的日期。 然后再给出一个起始日期,要求从这一天开始,算出 ...
分类:
其他好文 时间:
2017-11-27 21:50:23
阅读次数:
170