Beyond the Sora

拖延症晚期

hdu4549——M斐波那契数列(费马小定理+矩阵快速幂)

Problem Description M斐波那契数列F[n]是一种整数数列,它的定义如下:F[0] = a F[1] = b F[n] = F[n-1] * F[n-2] ( n > 1 )现在给出a, b, n,你能求出F[n]的值吗?Input 输入包含多组测试数据; 每组数...

2017-04-18 21:27:30

阅读数:652

评论数:0

poj1845——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-04-11 16:26:25

阅读数:796

评论数:0

poj3292——Semi-prime H-numbers(数论)

DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of 4n+1 numbers. Here, we do ...

2017-02-18 21:15:30

阅读数:651

评论数:0

poj2635——The Embarrassed Cryptographer(高精度取模)

DescriptionThe young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which i...

2017-02-18 12:37:47

阅读数:545

评论数:0

hdu5793——A Boring Question(快速幂+逆元)

Problem Description There are an equation. ∑0≤k1,k2,⋯km≤n∏1⩽j<’m(kj+1kj)%1000000007=? We define that (kj+1kj)=kj+1!kj!(kj+1−kj)! . And (kj+1kj)...

2016-08-09 10:51:28

阅读数:627

评论数:0

Lightoj1259——Goldbach`s Conjecture(哥德巴赫猜想)

Description Goldbach’s conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states:Every even integer, g...

2016-08-06 11:38:31

阅读数:1011

评论数:0

Lightoj1282——Leading and Trailing(幂取模求前三位)

Description You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.In...

2016-08-05 17:41:09

阅读数:586

评论数:0

Lightoj1336——Sigma Function(因子和)

Description Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes ...

2016-08-05 16:03:17

阅读数:413

评论数:0

Lightoj1341——Aladdin and the Flying Carpet(算术基本定理)

Description It’s said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerne...

2016-08-05 11:17:37

阅读数:654

评论数:0

lightoj1370——Bi-shoe and Phi-shoe(欧拉函数应用)

Description Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some b...

2016-08-04 20:14:12

阅读数:864

评论数:0

1~n中所有数的欧拉函数值

摘自刘汝佳的《算法竞赛入门经典》void phi_table(int n,int *phi) { for(int i=2; i<=n; ++i) phi[i]=0; phi[1]=1; for(int i=2; i<=n; ++i) ...

2016-08-03 17:42:27

阅读数:1082

评论数:0

poj1284——Primitive Roots(欧拉函数)

DescriptionWe say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (xi mod p) | 1 <= i <= p-1 }...

2016-08-03 17:31:22

阅读数:846

评论数:0

51nod1136——欧拉函数

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

2016-08-01 17:39:53

阅读数:805

评论数:0

51nod1080——两个数的平方和

给出一个整数N,将N表示为2个整数i j的平方和(i <= j),如果有多种表示,按照i的递增序输出。 例如:N = 130,130 = 3^2 + 11^2 = 7^2 + 9^2 (注:3 11同11 3算1种)Input 一个数N(1 <= N <= 10^9)Outp...

2016-08-01 17:15:51

阅读数:641

评论数:0

poj2109——Power of Cryptography

DescriptionCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in...

2016-06-01 16:39:09

阅读数:891

评论数:0

山东省第四届ACM省赛题——Alice and Bob(二进制)

题目描述 Alice and Bob like playing games very much.Today, they introduce a new game.There is a polynomial like this: (a0*x^(2^0)+1) * (a1 * x^(2^1)...

2016-05-28 16:31:32

阅读数:848

评论数:0

山东省第六届ACM省赛题——BIGZHUGOD and His Friends II(塞瓦定理,二分求解方程)

题目描述 BIGZHUGOD and his three friends are playing a game in a triangle ground. The number of BIGZHUGOD is 0, and his three friends are numbered from...

2016-05-25 20:48:49

阅读数:567

评论数:0

山东省第四届ACM省赛题——Square Number(平方数的性质)

题目描述 In mathematics, a square number is an integer that is the square of an integer. In other words, it is the product of some integer with itself. ...

2016-05-22 11:48:13

阅读数:983

评论数:0

集合划分问题(斯特林数模板)

Description n个元素的集合{1,2,…,n}可以划分若干个非空子集。例如,当n=4时,集合{1,2,3,4}可以划分为15个不同的非空子集如下:{{1},{2},{3},{4}}, {{1,2},{3},{4}}, {{1,3},{2},{4}}, {{1,4},{2},{3}...

2016-04-29 13:38:34

阅读数:943

评论数:0

hdu4135——Co-prime(容斥原理求区间互素)

Problem Description Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N. Two ...

2016-04-28 15:16:22

阅读数:845

评论数:0

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