小坏蛋_千千

I was caught in a heavy rain!

Nowcoder 105G 又见斐波那契 (矩阵快速幂)

题目描述 这是一个加强版的斐波那契数列,给定递推式 F(i)=⎧⎩⎨F(i−1)+F(i−2)+i3+i2+i+101i>1i=0i=1F(i)={F(i−1)+F(i−2)+i3+i2+i+1i>10i=01i=1 F(i)= \be...

2018-04-28 11:15:57

阅读数:78

评论数:0

HDU 3949 XOR (线性基,模板)

Description XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, w...

2018-04-27 19:47:46

阅读数:54

评论数:0

Nowcoder 105D Fibonacci 进制 (数论)

题目描述 Fibonacci 数是非常有名的一个数列,它的公式为 f(n)=f(n−1)+f(n−2),f(0)=1,f(1)=2f(n)=f(n−1)+f(n−2),f(0)=1,f(1)=2f(n)=f(n-1)+f(n-2),f(0)=1,f(1)=2 。 我们可以把任意一...

2018-04-27 11:21:06

阅读数:55

评论数:0

BZOJ 2115 [Wc2011] Xor (线性基)

Description 考虑一个边权为非负整数的无向连通图,节点编号为 1 到 N,试求出一条从 1 号节点到 N 号节点的路径,使得路径上经过的边权值的 XOR 和最大。 路径可以重复经过某些点或边,当一条边在路径中出现了很多次时,其权值在计算 XOR 和时也要被计算相应多的次...

2018-04-26 17:13:49

阅读数:47

评论数:0

Codeforces 963 A. Alternating Sum (逆元)

Description You are given two integers aaa and bbb. Moreover, you are given a sequence s0,s1,…,sns0,s1,…,sns_0, s_1, \dots, s_{n}. All values in ...

2018-04-19 20:47:09

阅读数:50

评论数:0

HDU 3826 Squarefree number (素数)

Description In mathematics, a squarefree number is one which is divisible by no perfect squares, except 1. For example, 10 is square-free but 18 is...

2017-10-09 18:15:08

阅读数:162

评论数:0

FZU 1759 Super A^B mod C (欧拉函数,降幂公式)

Description Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000).  Input There ar...

2017-10-04 12:02:23

阅读数:127

评论数:0

HDU 4609 3-idiots (FFT)

Description King OMeGa catched three men who had been streaking in the street. Looking as idiots though, the three men insisted that it was a kind ...

2017-08-15 20:57:09

阅读数:162

评论数:0

HDU 6069 Counting Divisors (素数)

Description In mathematics, the function d(n) denotes the number of divisors of positive integer n. For example, d(12)=6d(12)=6 because 1,2,3,...

2017-08-08 11:19:16

阅读数:166

评论数:0

51nod 1239 欧拉函数之和

描述 对正整数 n ,欧拉函数是小于或等于 n 的数中与 n 互质的数的数目。此函数以其首名研究者欧拉命名,它又称为 Euler’s totient function 、 φ 函数、欧拉商数等。例如:φ(8) = 4(Phi(8) = 4),因为 1,3,5,7 均和 8 互质。 S...

2017-08-05 10:33:32

阅读数:156

评论数:0

51nod 1244 莫比乌斯函数之和

描述 莫比乌斯函数,由德国数学家和天文学家莫比乌斯提出。梅滕斯(Mertens)首先使用μ(n)(miu(n))作为莫比乌斯函数的记号。具体定义如下: 如果一个数包含平方因子,那么miu(n) = 0。例如:miu(4), miu(12), miu(18) = 0。 如果一...

2017-08-04 20:39:57

阅读数:174

评论数:0

『数论』乘法逆元

在求解除法取模问题 (a/b)%m(a/b)\%m 时,我们可以转化为 (a%(b×m))/b(a\%(b×m))/b ,但是如果 bb 很大,则会出现爆精度问题,所以我们避免使用除法直接计算。可以使用逆元将除法转换为乘法:假设 bb 存在乘法逆元,即与 mm 互质(充要条件)。设 cc 是 bb...

2017-07-31 11:47:27

阅读数:260

评论数:0

HDU 6053 TrickGCD (莫比乌斯函数)

Description You are given an array AA , and Zhu wants to know there are how many different array BB satisfy the following conditions? 1≤Bi≤...

2017-07-28 14:05:10

阅读数:581

评论数:0

HDU 6050 Funny Function (规律+逆元)

Description Function Fx,yF_{x,y} satisfies: F1,1=F1,2=1F_{1,1}=F_{1,2}=1 F1,i=F1,i−1+2∗F1,i−2 (i>=3)F_{1,i}=F_{1,i-1}+2*F_{1,i-2}\ (i&...

2017-07-27 18:32:07

阅读数:526

评论数:4

HDU 5976 Detachment (逆元)

Problem Description In a highly developed alien society, the habitats are almost infinite dimensional space. In the history of this planet,the...

2017-05-02 16:15:45

阅读数:495

评论数:0

HDU 5974 A Simple Math Problem (数论+解方程组)

Problem Description Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least Common Multiple (X, Y) ...

2017-05-02 10:46:45

阅读数:390

评论数:0

HZAU 1202 GCD (矩阵快速幂 + GCD)

Problem Description Xiao Ming found the compute time of gcd(fibn,fibn+1)gcd(fib_n,fib_{n+1}) is the most when he learnt the gcd, and the result of ...

2017-04-23 19:58:04

阅读数:531

评论数:0

POJ 2891 Strange Way to Express Integers (扩展欧几里得)

Description Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as ...

2017-04-18 11:20:54

阅读数:353

评论数:0

POJ 2115 C Looooops (扩展欧几里得)

Description A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement; ...

2017-01-27 17:45:12

阅读数:195

评论数:0

POJ 1845 Sumdiv (数论,约数和)

DescriptionConsider 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 o...

2017-01-21 14:04:38

阅读数:226

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭