题目链接:hdu 5676 一开始看题还以为和数位dp相关的,后来才发现是搜索题,我手算了下,所有的super lucky number(也就是只含数字4, 7且4, 7的数量相等的数)加起来也不过几万个,可以采用打表的方法来把所有的super lucky number存储起来。因为4,7数量须相等 ...
分类:
其他好文 时间:
2016-05-10 23:17:52
阅读次数:
200
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5647 题解: 令dp[u][0]表示u所在的子树中所有的包含i的集合数,设u的儿子为vi,则易知dp[u][0]=(dp[v1][0]+1)*...*(dp[vk][0]+1)。 令dp[u][1]表 ...
分类:
其他好文 时间:
2016-05-09 01:30:16
阅读次数:
157
Feed the dogs
Time Limit: 6000MS
Memory Limit: 65536K
Total Submissions: 17679
Accepted: 5561
Description
Wind loves pretty dogs very much, and she has n pet dogs. So...
分类:
其他好文 时间:
2016-05-06 12:19:58
阅读次数:
276
ztr loves math http://acm.hdu.edu.cn/showproblem.php?pid=5675 显然:4 ^ n * (a + b) * (a -b) ...
分类:
其他好文 时间:
2016-05-06 02:02:39
阅读次数:
130
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5676
ztr loves lucky numbers
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 594 A...
分类:
其他好文 时间:
2016-05-03 18:41:18
阅读次数:
164
1、HDU 5676 ztr loves lucky numbers
题意:
求大于等于 n(1≤ n ≤10^18) 的各位数字只包含4和7且4和7数量相等的数字
解题思路:
初始化求出位数
二分查找结果
注意特判10个4、10个7的解
#include
#include
#include
#include
#include
using namesp...
分类:
其他好文 时间:
2016-05-03 18:14:59
阅读次数:
169
题目链接: hdu 5677 ztr loves substring 官方题解: //这部分是错的(首先,对于每一个串i跑一次manancher,令g[i][j]=p[j]-1g[i][j]=p[j]?1 这样,g就存储了所有的回文子串的长度 为了方便,把g降到一维表示) 首先,因为字符串长度较小, ...
分类:
其他好文 时间:
2016-05-03 00:30:23
阅读次数:
239
Problem Description ztr loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn't contain digits o ...
分类:
其他好文 时间:
2016-05-02 20:03:42
阅读次数:
220
Problem Description ztr loves research Math.One day,He thought about the "Lower Edition" of triangle equation set.Such as n=x2?y2. He wanted to know t ...
分类:
其他好文 时间:
2016-05-02 18:41:26
阅读次数:
130