Instability HDU - 5917(Ramsey定理)

Instability HDU - 5917 Long long ago, there was a prosperous kingdom which consisted of n cities and every two cites were connected by an undirected ...

2018-09-25 17:11:25

阅读数:39

评论数:0

Expressions UVA - 10157(组合数学+递推)

Expressions UVA - 10157 题目: 给你n个括号,求合法的匹配中,深度不超过d的组合数。 分析: 组合,计数,dp,大整数。 这个题目很像卡特兰数,不过深度有限制,可以利用卡特兰数的递推公式求解; 设DP(k,d)为k对括号形成深度不超过d的合法匹配方法数;则有: DP(k,d...

2018-09-23 09:09:10

阅读数:29

评论数:0

Counting UVA - 10198(线性递推式)

Counting UVA - 10198 题意: Gustavo数数时总是把1和4搞混,他认为4只是1的另外一种写法。给出一个整数n,Gustavo想知道有多少个数的数字之和恰好为n。例如,当n=2时,有5个数:11、14、41、44、2。 分析: 设dp[n]表示加和为n的组合的个数 那么很明显...

2018-09-22 09:33:02

阅读数:60

评论数:0

Sum HDU - 4407(容斥定理)

Sum HDU - 4407 XXX is puzzled with the question below: 1, 2, 3, …, n (1<=n<=400000) are placed in a line. There are m (1&am...

2018-09-21 13:30:04

阅读数:23

评论数:0

Puzzled Elena HDU - 5468(dfs序+容斥定理)

Puzzled Elena HDU - 5468 Since both Stefan and Damon fell in love with Elena, and it was really difficult for her to choose. Bonnie, her best frien...

2018-09-14 19:56:12

阅读数:38

评论数:0

2018ACM-ICPC徐州赛区网络赛: A. Hard to prepare(递推)

2018ACM-ICPC徐州赛区网络赛: A. Hard to prepare(递推) After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nog...

2018-09-11 09:36:09

阅读数:102

评论数:0

ACM-ICPC 2018 沈阳赛区网络预赛 G.Spare Tire (容斥)

Spare Tire A sequence of integer {an}\lbrace a_n \rbrace{an​} can be expressed as: an={0,n=02,n=13an−1−an−22+n+1,n>1\displaystyle a_n = ...

2018-09-09 10:09:12

阅读数:78

评论数:3

Jesus Is Here HDU - 5459(思维+数学递推)

Jesus Is Here HDU - 5459 I’ve sent Fang Fang around 201314 text messages in almost 5 years. Why can’t she make sense of what I mean? But Jesus is h...

2018-08-30 14:23:17

阅读数:63

评论数:0

Problem G. Cyclic HDU - 6432(容斥原理)

Problem G. Cyclic HDU - 6432 Count the number of cyclic permutations of length n with no continuous subsequence [i, i + 1 mod n]. Output the answer...

2018-08-27 16:41:03

阅读数:71

评论数:1

Gcd(莫比乌斯反演)

Gcd 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的 数对(x,y)有多少对. Input 一个整数N Output 如题 Sample Input 4 Sample Output 4 Hint ...

2018-08-23 08:23:05

阅读数:66

评论数:0

Mophues(莫比乌斯反演+分段)

Mophues As we know, any positive integer C ( C >= 2 ) can be written as the multiply of some prime numbers: C = p1×p2× p3× ... × pk ...

2018-08-22 20:02:36

阅读数:56

评论数:0

Primes in GCD Table SPOJ - PGCD(莫比乌斯反演+分段)

Primes in GCD Table SPOJ - PGCD Johnny has created a table which encodes the results of some operation -- a function of two arguments. But instead o...

2018-08-21 20:29:47

阅读数:67

评论数:0

Character Encoding HDU - 6397(容斥原理解决方程解个数经典问题详解)

Character Encoding HDU - 6397 In computer science, a character is a letter, a digit, a punctuation mark or some other similar symbol. Since computer...

2018-08-21 13:59:58

阅读数:130

评论数:0

cf 997c Sky Full of Stars(组合数+容斥原理)

Sky Full of Stars On one of the planets of Solar system, in Atmosphere University, many students are fans of bingo game. It is well known that one ...

2018-08-21 13:58:24

阅读数:104

评论数:0

Visible Lattice Points(莫比乌斯反演经典)

Visible Lattice Points Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible fr...

2018-08-20 19:53:30

阅读数:58

评论数:0

Sum Of Gcd(欧拉函数+莫队算法详解)

Sum Of Gcd Given you a sequence of number a 1, a 2, ..., a n, which is a permutation of 1...n. You need to answer some queries, each with the follo...

2018-08-15 21:26:46

阅读数:59

评论数:0

GuGuFishtion HDU - 6390(莫比乌斯反演+线性求逆元)

GuGuFishtion HDU - 6390 Today XianYu is too busy with his homework, but the boring GuGu is still disturbing him!!!!!! At the break time, an evil id...

2018-08-15 10:48:39

阅读数:132

评论数:2

HDU 4675 GCD of Sequence(数论+组合数学||莫比乌斯反演)

GCD of Sequence Alice is playing a game with Bob. Alice shows N integers a 1, a 2, …, a N, and M, K. She says each integers 1 ≤ a i ≤ M. And now Al...

2018-08-13 20:03:50

阅读数:54

评论数:0

POJ 3904 Sky Code(容斥原理)

Sky Code Stancu likes space travels but he is a poor software developer and will never be able to buy his own spacecraft. That is why he is preparin...

2018-08-10 20:53:45

阅读数:34

评论数:0

bookshelf HDU - 6363(数论结论+莫比乌斯反演)

bookshelf HDU - 6363 Patrick Star bought a bookshelf, he named it ZYG !! Patrick Star has N book . The ZYG has K layers (count from 1 to K) and th...

2018-08-10 16:31:19

阅读数:140

评论数:0

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