![](https://img-blog.csdnimg.cn/20190927151026427.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
数论
文章平均质量分 91
数论
Charon_HN
NLP炼丹儿
展开
-
HDU 1211 (逆元)扩展欧几里得+快速幂
题目链接Problem DescriptionRSA is one of the most powerful methods to encrypt data. The RSA algorithm is described as follow:choose two large integer p, qcalculate n = p * q, calculate F(n) = (p - 1) * (q - 1)choose an integer e(1 < e < F(n)), maki原创 2021-04-05 21:48:26 · 157 阅读 · 0 评论 -
2019牛客暑期多校训练营(第九场)B Quadratic equation 二次剩余(逆元)
题目链接样例输入:104 45 610 1010 2520000 1000000000 53 6220 2840 11000000000 1000000000输出:2 22 3-1 -15 510000 10000474848249 525151758352077071 647922939448762649 551237578-1 -1366417...原创 2019-08-15 21:17:18 · 239 阅读 · 0 评论 -
2019杭电多校第二场1005 = HDU6595(逆元)
Everything Is Generated In Equal ProbabilityOne day, Y_UME got an integer N and an interesting program which is shown below:Y_UME wants to play with this program. Firstly, he randomly generates an ...原创 2019-07-26 12:00:12 · 262 阅读 · 0 评论 -
Chosen by god FZU - 2301(逆元)
Chosen by godEveryone knows there is a computer game names "hearth stone", recently xzz likes this game very much. If you want to win, you need both capacity and good luck.There is a spell card...原创 2019-04-29 14:32:08 · 424 阅读 · 0 评论 -
POJ 2429 分解质因数
https://vjudge.net/problem/POJ-2429Given two positive integers a and b, we can easily calculate the greatest common divisor (GCD) and the least common multiple (LCM) of a and b. But what about the in...原创 2020-03-30 22:02:12 · 365 阅读 · 0 评论 -
2019牛客暑期多校训练营(第九场) A The power of Fibonacci 斐波那契循环节
题目链接分析:首先,我们要知道fibonacci序列模n的话是有一个循环节的存在,那对于题目这样的fibonacci也同样是有循环节的存在;我们知道Fibonacci数列,现在我们来求一个Fib数模n的循环节的长度。对于一个正整数n,我们求Fib数模n的循环节的长度的方法如下:(1)把n素因子分解,即n=p1^a1*p2^a2……pk^ak(2)分别计算Fib数模每个p^m的循...原创 2019-08-22 17:03:47 · 253 阅读 · 0 评论 -
UVA - 10791 分解质因数(唯一分解定理)
参考https://www.cnblogs.com/scau20110726/archive/2013/01/18/2866101.html 题意(就是因为读错题意而wa了一次):给一个数字n,范围在[1,2^23-1],这个n是一系列数字的最小公倍数,这一系列数字的个数至少为2例如12,是1和12的最小公倍数,是3和4的最小公倍数,是1,2,3,4,6,12的最小公倍数,是12和...原创 2018-11-17 19:17:03 · 487 阅读 · 0 评论 -
UVA 11076(数论 不全相异元素全排列)
题目链接:https://cn.vjudge.net/contest/269773?tdsourcetag=s_pcqq_aiomsg#problem/G题意:给你N个数,求把他们的全排列加和为多少参考https://www.cnblogs.com/hbutACMER/p/4235696.html考虑任意一位i,假设我们在i位放置x,则对应(n−1)!/(d0!∗d1!∗...∗dx!...原创 2018-11-15 20:31:45 · 579 阅读 · 0 评论 -
POJ 3421 多重组合排列
Given a positive integer X, an X-factor chain of length m is a sequence of integers,1 = X0, X1, X2, …, Xm = XsatisfyingXi < Xi+1 and Xi | Xi+1 where a | b means a perfectly divides into b.N...原创 2018-10-16 20:13:23 · 166 阅读 · 0 评论 -
UPC 5215 逆元的应用+不知道的数学公式
5215: Fence Building时间限制: 1 Sec 内存限制: 128 MB提交: 404 解决: 75[提交] [状态] [讨论版] [命题人:admin]题目描述Farmer John owns a farm. He first builds a circle fence. Then, he will choose n points and build so...原创 2018-08-22 08:00:11 · 137 阅读 · 0 评论