2016-07-24
A positive proper divisor is a positive divisor of a number n, excluding n itself. For example, 1, 2, and 3 are positive proper divisors of 6, but 6 itself is not.Peter has two positive integers n and d. He would like to know the number of integers below n whose maximum positive proper divisor is d.
阅读全文
2016-07-24
我们可以把第i层跟第i+1层之间楼梯的通断性构造成一个2*2的通断性矩阵,1表示通,0表示不通。那么从第a层到第b层,就是将a到b-1的通断性矩阵连乘起来,然后将得到的答案矩阵上的每个元素加起来即为方案数。想到矩阵的乘法是满足结合律的,那么我们可以用线段树来维护矩阵的乘积。每次我们只会修改某一个楼梯的通断性,所以就只是简单的线段树单点更新,成段求乘积而已。
阅读全文
2016-07-23
You are given a string S consisting of lowercase letters, and your task is counting the number of substring that the number of each lowercase letter in the substring is no more than K.
阅读全文
2016-07-23
DP的思想自从进入ACM队之后就有所了解,虽然偶尔做出过几道题,但是还是停留在“有所理解”的层次上。昨天做了[HDU_5067](http://acm.hdu.edu.cn/showproblem.php?pid=5067),在聪明的卓君的教导下,突然感觉新世界的大门打开了……
阅读全文
2016-07-22
2016年7月21日HDU的多校比赛第二场中倒数第二题“La Vie en rose”(5745)的题解用到了bitset压缩,本宝宝表示更本不知道什么是Bitset,于是自学一番,发现了一块专门用来DIY模拟的新大陆——STL Bitset
阅读全文