数论
aero1009
这个作者很懒,什么都没留下…
展开
-
Codeforce 450B Jzzhu and Sequences 矩阵快速幂
Jzzhu has invented a kind of sequences, they meet the following property: You are given x and y, please calculate fn modulo 1000000007 (109 + 7). The first line contains two integers x and y (|x|...原创 2018-07-29 22:53:55 · 151 阅读 · 0 评论 -
LightOJ - 1067 Combinations(逆元求组合数)
Given n different objects, you want to take k of them. How many ways to can do it? For example, say there are 4 items; you want to take 2 of them. So, you can do it 6 ways. Take 1, 2 Take 1, 3 Ta...原创 2018-08-05 22:15:18 · 234 阅读 · 0 评论 -
HDU - 5685 逆元+前缀积
度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串。现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的哈希值。一个字符串的哈希值,由以下公式计算得到: H(s)=∏i≤len(s)i=1(Si−28) (mod 9973)H(s)=∏i=1i≤len(s)(Si−28) (mod 9973) SiSi 代表 S[i] 字符的 ASCII...原创 2018-08-05 22:18:04 · 253 阅读 · 0 评论 -
POJ - 1845 Sumdiv (质因数分解+快速幂+等比数列快速求和)
Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901). Input The only line contains the two natural ...原创 2018-08-05 22:22:35 · 208 阅读 · 0 评论 -
HDU - 1005 Number Sequence(长得像矩阵快速幂的找规律)
A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). Input The input consists of multi...原创 2018-08-05 22:25:50 · 171 阅读 · 0 评论 -
HDU - 4686 Arc of Dream(5*5构造矩阵快速幂)
An Arc of Dream is a curve defined by following function: where a 0 = A0 a i = a i-1*AX+AY b 0 = B0 b i = b i-1*BX+BY What is the value of AoD(N) modulo 1,000,000,007? Input There are multiple ...原创 2018-08-05 22:28:25 · 207 阅读 · 0 评论