dp
殇星痕
这个作者很懒,什么都没留下…
展开
-
LightOJ 1138(求末尾零个数)
Description You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains on原创 2017-08-12 16:23:10 · 287 阅读 · 0 评论 -
计算直线的交点数(HDU-1466)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1466 Problem Description 平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。 比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input 输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(原创 2017-08-14 10:01:35 · 425 阅读 · 0 评论 -
Frequent values(POJ-1806)(RMQ)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1806 Problem Description You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given seve原创 2017-08-15 20:04:50 · 289 阅读 · 0 评论 -
Love Calculator(LightOJ-1013)(LCS+DP)
1013 - Love Calculator PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Yes, you are developing a 'Love calculator'. The soft原创 2018-01-30 18:21:56 · 311 阅读 · 0 评论 -
F-德玛西亚万岁(状压DP)(2018年全国多校算法寒假训练营练习比赛(第二场))
题目链接: https://www.nowcoder.com/acm/contest/74/F 题目大意: 给你n*m大小的棋盘,其中1可以放置英雄,0不能放置。而放置英雄的格子的上下左右不能再放置英雄。输出总共有多少种放置方法,结果对100000000取模。 题目分析: 比赛时完全懵逼,只是知道是dp。在赛后看了一位大神的代码才知道如何实现这道题的正确做法。数据n,m最大原创 2018-01-30 09:48:57 · 396 阅读 · 0 评论