04 2012 档案

hdu 3709
摘要:数位DP!!题意:给一个很大的区间[x,y],(0 ≤ x ≤ y ≤ 1018).问:区间里面的数满足如下规则的有多少个?规则:将数字放在天平上,天平能够平衡。天平的轴随意,力臂就是数字下标到天平轴的下标的距离。思路:典型的数位DP,不过有一些技巧快速判断数字是不是满足规则。定义:区间分解:[X,Y]=[0,Y] -[0,X-1]对于小于X的数:sdig=sum(digit(i)){i=1..n,digit(i)表示数的第i个数字}snum=sum(i*digit(i)){i=1..n}每一次判断大数是不是平衡的,就看snum%sdig是不是0.因为:如果将轴放在最高位的左边,那么天平将偏向 阅读全文

posted @ 2012-04-15 16:52 kevinkitty 阅读(466) 评论(0) 推荐(0)

poj 3498
摘要:source:http://poj.org/problem?id=3498March of the PenguinsTime Limit:8000MSMemory Limit:65536KTotal Submissions:3345Accepted:1532DescriptionSomewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would like to get together, all on 阅读全文

posted @ 2012-04-02 22:01 kevinkitty 阅读(860) 评论(0) 推荐(0)

导航