上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6198 F0=0,F1=1的斐波那契数列。 给定K,问最小的不能被k个数组合而成的数是什么。 赛后才突然醒悟,只要间隔着取k+1个数,显然根据斐波那契数列规律是不存在把其中两个数相加的结果又出现在数列中的情况(有特 阅读全文
posted @ 2017-09-10 21:57 Luke_Ye 阅读(160) 评论(0) 推荐(0) 编辑
摘要: const LL N = 100005; LL num[N]; LL dp[N]; LL go(LL l, LL r, LL k) { for (; r >= l; r--) if (dp[r] = 0) { if (r - l > 1; if (dp[mid] > k) r = mid; e... 阅读全文
posted @ 2017-09-10 21:47 Luke_Ye 阅读(146) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4507 求[L,R]中不满足任意条件的数的平方和mod 1e9+7。 条件: 1、整数中某一位是7;2、整数的每一位加起来的和是7的整数倍;3、这个整数是7的整数倍; 首先想到数位DP,我们看下如何维护。 最基本的 阅读全文
posted @ 2017-09-07 23:17 Luke_Ye 阅读(306) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3652 求解所有含有13且被13整除的数。 思路:除了数位DP基本的两维,还需要维护数字头部情况,此外遇到整除问题,我们还需要维护余数。 阅读全文
posted @ 2017-09-07 16:06 Luke_Ye 阅读(127) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2089 数位DP的思想时预处理以x开头长度为len的数(例如 x000~x999)的所有情况。给出一个数,可以在log10(n)的复杂度下完成分解。 阅读全文
posted @ 2017-09-07 16:02 Luke_Ye 阅读(231) 评论(0) 推荐(0) 编辑
摘要: hash[i]=(hash[i-1]*p+idx(s[i]))%mod p和mod取不同的较大的素数 阅读全文
posted @ 2017-09-03 16:59 Luke_Ye 阅读(128) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/problemset/problem/848/B 给定一个二维坐标系,点从横轴或纵轴垂直于发射的坐标轴射入(0,0)-(w,h)的矩形空间。给出点发射的坐标轴,位置,延迟时间,发生碰撞则交换方向。求最后每个点的射出位置。 首先我们观察能得出两个结论,1. 阅读全文
posted @ 2017-09-03 14:40 Luke_Ye 阅读(344) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2419 给一个图,预分配点值。随后有三种操作,F u v查询与u联通部分大于等于v的最小的数,没有则返回0,U u v更新u的值为v,E u v删除u-v的边。 联通块可以用并查集解决,但是删边无法处理。因为没有加 阅读全文
posted @ 2017-08-30 15:41 Luke_Ye 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 给定A,B,对于A^B的每一个因子,M为其因子的因子数的三次方求和。 容易推导得出A^B的每一个因子都是A的质因子的组合(质因子可重复利用),其因子数自然等于所使用的每个质因子的数量乘积。 假设A由质因子a1,a2,a3组合而成,对应数量为k1,k2,k3,那么A的因子数为(k1+1)*(k2+1) 阅读全文
posted @ 2017-08-30 11:35 Luke_Ye 阅读(253) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #define LL long long using namespace std; const LL MAXN = 550; const LL INF = 1000000009; LL n, m, e... 阅读全文
posted @ 2017-08-30 10:20 Luke_Ye 阅读(354) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页