Live2d Test Env

随笔分类 -  DP——数位DP

摘要:B .Counting Inversion 题意:给定L,R,求这个区间的逆序对数之和。(L,R<1e15) 思路:一看这个范围就知道是数位DP。 只是维护的东西稍微多一点,需要记录后面的各种数字的个数cnt,以及逆序对和sum,以及出现了多少种后缀num。 那么枚举到当前位时,假设为i ,那么su 阅读全文
posted @ 2019-02-09 16:23 nimphy 阅读(576) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-12-01 20:04 nimphy 阅读(426) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-11-18 22:43 nimphy 阅读(231) 评论(0) 推荐(0) 编辑
摘要:时间限制:24000ms 单点时限:3000ms 内存限制:256MB 时间限制:24000ms 单点时限:3000ms 内存限制:256MB 描述 给定 n 和 k。计算有多少长度为 k 的数组 a1, a2, ..., ak,(0≤ai) 满足: a1 + a2 + ... + ak = n。 阅读全文
posted @ 2017-12-05 11:11 nimphy 阅读(370) 评论(0) 推荐(0) 编辑
摘要:有趣的子区间 有趣的子区间 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 如果一个区间[a, b]内恰好包含偶数个回文整数,我们就称[a, b]是有趣的区间。 例如[9, 12]包含两个回文整数9和11,所以[9, 12]是有趣的区间。[12, 20]包含0个回文整数 阅读全文
posted @ 2017-11-09 17:23 nimphy 阅读(216) 评论(0) 推荐(0) 编辑
摘要:(写挂了,有空再补) 时间限制:10000ms 单点时限:1000ms 内存限制:256MB (写挂了,有空再补) 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个数 x,设它十进制展从高位到低位上的数位依次是 a0, a1, ..., an - 1,定义交错和 阅读全文
posted @ 2017-11-03 11:07 nimphy 阅读(410) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-11-01 10:46 nimphy 阅读(273) 评论(0) 推荐(0) 编辑
摘要:简单题:HDU2089 HDU3652 HDU4734 HDU3555 POJ3252 HigoCoder1033(需要前导0,或者用方法4) 总结: 1,dfs(pos,state,limit,begin_zero) 只是大概方程,根据不同的条件有不同的限制。 2,减少memset可以时间上优化, 阅读全文
posted @ 2017-11-01 09:33 nimphy 阅读(180) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示