Revenge of GCD (枚举+gcd)

Revenge of GCD In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or g...

2018-07-31 19:31:26

阅读数:46

评论数:0

GCD and LCM(质因子分解+组合数学)

GCD and LCM Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and ...

2018-07-31 19:02:47

阅读数:37

评论数:0

Second My Problem First(单调队列)

Second My Problem First Give you three integers n, A and B. Then we define S i = A i mod B and T i = Min{ S k | i-A <= k <= i...

2018-07-31 13:11:51

阅读数:33

评论数:0

志愿者选拔(单调队列)

志愿者选拔 世博会马上就要开幕了,福州大学组织了一次志愿者选拔活动。 参加志愿者选拔的同学们排队接受面试官们的面试。参加面试的同学们按照先来先面试并且先结束的原则接受面试官们的考查。 面试中每个人的人品是主要考查对象之一。(提高人品的方法有扶老奶奶过街,不闯红灯等) 作为主面试官的John想知...

2018-07-31 12:49:59

阅读数:95

评论数:0

Subsequence(单调队列)

Subsequence There is a sequence of integers. Your task is to find the longest subsequence that satisfies the following condition: the difference be...

2018-07-31 12:30:26

阅读数:35

评论数:0

Problem F. Grab The Tree HDU - 6324(思维+博弈)

Problem F. Grab The Tree HDU - 6324 Little Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2,…,n, connec...

2018-07-31 10:11:34

阅读数:188

评论数:0

Problem A. Ascending Rating HDU - 6319(单调队列)

题意: 找到1-n中间每个间隔为m的最大值,和获得这个最大值的比较次数,然后按照题目所给公式将每个区间的结果异或i得到最终结果 分析: 首先观察数据我们知道,一定不能跑二次循环,即每个枚举每个区间,然后在每个区间中再遍历比较最大值并记录次数,这样的复杂度是O(mn)的必然超时,因...

2018-07-31 09:54:38

阅读数:38

评论数:0

Covered Points Count(思维)

Covered Points Count You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degen...

2018-07-31 08:26:50

阅读数:38

评论数:0

hide handkerchief (gcd)

hide handkerchief The Children’s Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played...

2018-07-30 18:31:52

阅读数:42

评论数:0

Special Prime(数论+思维)

Special Prime Give you a prime number p, if you could find some natural number (0 is not inclusive) n and m, satisfy the following expression: ...

2018-07-30 08:58:10

阅读数:54

评论数:0

本原串 (思维+快速幂+枚举约数)

本原串 由0和1组成的串中,不能表示为由几个相同的较小的串连接成的串,称为本原串,有多少个长为n(n<=100000000)的本原串? 答案mod2008. 例如,100100不是本原串,因为他是由两个100组成,而1101是本原串。 Input 输入包括多...

2018-07-30 07:17:43

阅读数:44

评论数:0

f(n) HDU 2582(找规律+筛素数+质因子分解详解)

HDU 2582 f(n) This time I need you to calculate the f(n) . (3<=n<=1000000) f(n)= Gcd(3)+Gcd(4)+…+Gcd(i)+…+Gcd(n). Gcd(n)=gcd...

2018-07-28 17:10:57

阅读数:40

评论数:0

Number Sequence (正解:矩阵快速幂)

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 a...

2018-07-28 11:15:39

阅读数:77

评论数:0

Happy 2004 (因数和公式+逆元)

Happy 2004 Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the...

2018-07-28 08:43:37

阅读数:32

评论数:0

七夕节 (约数和公式简单运用)

七夕节 七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下: 数字N的因子就是所有比N小又能被N整除的...

2018-07-28 08:21:36

阅读数:105

评论数:0

Pangu and Stones HihoCoder - 1636 (区间dp)

Pangu and Stones HihoCoder - 1636 In Chinese mythology, Pangu is the first living being and the creator of the sky and the earth. He woke up from an...

2018-07-28 08:03:51

阅读数:42

评论数:0

Secret Poems HihoCoder - 1632(模拟)

Secret Poems HihoCoder - 1632 The Yongzheng Emperor (13 December 1678 – 8 October 1735), was the fifth emperor of the Qing dynasty of China. He was ...

2018-07-27 19:51:58

阅读数:77

评论数:0

Cats and Fish HihoCoder - 1631(思维模拟)

Cats and Fish HihoCoder - 1631 There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good ...

2018-07-27 18:30:55

阅读数:41

评论数:0

The number of divisors(约数) about Humble Numbers(约数个数公式)

The number of divisors(约数) about Humble Numbers A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4...

2018-07-26 13:18:51

阅读数:78

评论数:0

Beijing 2008(快速幂模+逆元不存在时的处理)

Beijing 2008 As we all know, the next Olympic Games will be held in Beijing in 2008. So the year 2008 seems a little special somehow. You are looki...

2018-07-22 21:15:46

阅读数:306

评论数:2

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