随笔分类 - DP——数位DP
摘要:B .Counting Inversion 题意:给定L,R,求这个区间的逆序对数之和。(L,R<1e15) 思路:一看这个范围就知道是数位DP。 只是维护的东西稍微多一点,需要记录后面的各种数字的个数cnt,以及逆序对和sum,以及出现了多少种后缀num。 那么枚举到当前位时,假设为i ,那么su
阅读全文
摘要:You are given two integers l l and r r (l≤r l≤r ). Your task is to calculate the sum of numbers from l l to r r (including l l and r r ) such that eac
阅读全文
摘要:A palindromic number or numeral palindrome is a 'symmetrical' number like 16461 that remains the same when its digits are reversed. In this problem yo
阅读全文
摘要:时间限制:24000ms 单点时限:3000ms 内存限制:256MB 时间限制:24000ms 单点时限:3000ms 内存限制:256MB 描述 给定 n 和 k。计算有多少长度为 k 的数组 a1, a2, ..., ak,(0≤ai) 满足: a1 + a2 + ... + ak = n。
阅读全文
摘要:有趣的子区间 有趣的子区间 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 如果一个区间[a, b]内恰好包含偶数个回文整数,我们就称[a, b]是有趣的区间。 例如[9, 12]包含两个回文整数9和11,所以[9, 12]是有趣的区间。[12, 20]包含0个回文整数
阅读全文
摘要:(写挂了,有空再补) 时间限制:10000ms 单点时限:1000ms 内存限制:256MB (写挂了,有空再补) 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个数 x,设它十进制展从高位到低位上的数位依次是 a0, a1, ..., an - 1,定义交错和
阅读全文
摘要:The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb coun
阅读全文
摘要:简单题:HDU2089 HDU3652 HDU4734 HDU3555 POJ3252 HigoCoder1033(需要前导0,或者用方法4) 总结: 1,dfs(pos,state,limit,begin_zero) 只是大概方程,根据不同的条件有不同的限制。 2,减少memset可以时间上优化,
阅读全文