随笔分类 - Codeforces
摘要:题目链接:传送门 题解: 设定dp[i][j]在深度为i下,使用j个节点的方案数 显然的转移方程组就是 dp[h][n] = dp[h-1][i] * dp[h-1][n-i-1] + 2*dp[h-1][i]*dp[h-2][n-i-1]; 卷积形式 利用FFT加速求解dp[h] 下面是AC代码
阅读全文
摘要:D. The Bakery Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which can bake s
阅读全文
摘要:E. Liar The first semester ended. You know, after the end of the first semester the holidays begin. On holidays Noora decided to return to Vičkopolis.
阅读全文
摘要:D. My pretty girl Noora In Pavlopolis University where Noora studies it was decided to hold beauty contest "Miss Pavlopolis University". Let's describ
阅读全文
摘要:C. Hacker, pack your bags! It's well known that the best way to distract from something is to do one's favourite thing. Job is such a thing for Leha.
阅读全文
摘要:B. Crossword solving Erelong Leha was bored by calculating of the greatest common divisor of two factorials. Therefore he decided to solve some crossw
阅读全文
摘要:A. I'm bored with life Holidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams which is loc
阅读全文
摘要:E. Thief in a Shop A thief made his way to a shop. As usual he has his lucky knapsack with him. The knapsack can contain k objects. There are n kinds
阅读全文
摘要:E. Okabe and El Psy Kongroo Okabe likes to take walks but knows that spies from the Organization could be anywhere; that's why he wants to know how ma
阅读全文
摘要:F. Group Projects F. Group Projects There are n students in a class working on group projects. The students will divide into groups (some students may
阅读全文
摘要:C. Karen and Supermarket On the way home, Karen decided to stop by the supermarket to buy some groceries. She needs to buy a lot of goods, but since s
阅读全文
摘要:E. Army Creation As you might remember from our previous rounds, Vova really likes computer games. Now he is playing a strategy game known as Rage of
阅读全文
摘要:E. Scheme To learn as soon as possible the latest news about their favourite fundamentally new operating system, BolgenOS community from Nizhni Tagil
阅读全文
摘要:F. Leha and security system Bankopolis, the city you already know, finally got a new bank opened! Unfortunately, its security system is not yet workin
阅读全文
摘要:E. Prairie Partition It can be shown that any positive integer x can be uniquely represented as x = 1 + 2 + 4 + ... + 2k - 1 + r, where k and r are in
阅读全文
摘要:题目链接:点这里 题意: 1~N标号的球 现在A有C个,B有C个 每次可以随机得到D个不同的球(1~N);问你A或B中的C个球都出现一次的 期望次数 题解: dp[i][j][k]表示 随机出现了i个仅仅属于A的球的个数,仅仅属于B的球的个数,同时属于A,B的球的个数
阅读全文
摘要:题目链接:点这里 题意: 让你构造一个长度范围在[A,B]之间 字符串(大小写字母,数字),问你有多少种方案 需要满足条件一下: 1:构成串中至少包含一个数字,一个大写字母,一个小写字母; 2:不能包含给定的N个病毒串 3:遵循一堆映射规则 题解: 将病毒串建立AC自动机 设定dp[i][j] [0
阅读全文
摘要:C. Divide by Three A positive integer number n is written on a blackboard. It consists of not more than 105 digits. You have to transform it into a be
阅读全文
摘要:D. Felicity's Big Secret Revealed The gym leaders were fascinated by the evolutions which took place at Felicity camp. So, they were curious to know a
阅读全文
摘要:F. PolandBall and Gifts It's Christmas time! PolandBall and his friends will be giving themselves gifts. There are n Balls overall. Each Ball has some
阅读全文