Live2d Test Env

随笔分类 -  数学——中国剩余定理

摘要:题意:求Σfi^m%p。 zoj上p是1e9+7,牛客是1e9; 对于这两个,分别有不同的做法。 前者利用公式,公式里面有sqrt(5),我们只需要二次剩余求即可。 后者mod=1e9,5才mod下没有二次剩余,所以不能这么做了。可以分解mod,然后利用循环节搞。 zoj: #include <bi 阅读全文
posted @ 2019-08-16 13:00 nimphy 阅读(291) 评论(0) 推荐(0) 编辑
摘要:Lakhesh loves to make movies, so Nephren helps her run a cinema. We may call it No. 68 Cinema. However, one day, the No. 68 Cinema runs out of changes 阅读全文
posted @ 2018-09-07 11:02 nimphy 阅读(458) 评论(0) 推荐(0) 编辑
摘要:Today Pari and Arya are playing a game called Remainders. Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the 阅读全文
posted @ 2018-03-13 17:51 nimphy 阅读(403) 评论(0) 推荐(1) 编辑
摘要:给定n,(n<=10^3),然后输入n的数a[i],(a[i]<=1e10),求ans=(a1+a2+a3...an)! / (a1!*a2!*a3!...an!) 的结果的最一位数。 适用问题,n种物品,求全排种类,结果%10。 猜想1,斯特林公式,斯特林公式虽然误差越来越小,但是最后一位的误差是 阅读全文
posted @ 2018-02-13 16:21 nimphy 阅读(254) 评论(0) 推荐(0) 编辑
摘要:之前题目比较水,今天的还可以。 【A 不凡的大夫】 方法一:答案是log8(n!),解决方案是预处理,将需要的答案记录下来以免超内存; 方法二:用公式,斯特林公式: 【B 一个小问题】 题解:线性同余方程组,一看就不是中国剩余定理,当心。 【C 守护白起】 题解:polya。。。。。比赛的时候忘记加 阅读全文
posted @ 2018-02-04 19:43 nimphy 阅读(397) 评论(3) 推荐(1) 编辑
摘要: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 阅读全文
posted @ 2017-12-17 21:14 nimphy 阅读(270) 评论(0) 推荐(0) 编辑
摘要:Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following: Choo 阅读全文
posted @ 2017-12-17 19:12 nimphy 阅读(229) 评论(0) 推荐(0) 编辑
摘要:One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六 阅读全文
posted @ 2017-12-17 09:42 nimphy 阅读(622) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-12-16 20:22 nimphy 阅读(416) 评论(0) 推荐(0) 编辑
摘要:>On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave becau 阅读全文
posted @ 2017-12-16 16:31 nimphy 阅读(335) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示