随笔分类 -  algorithm - basic

摘要:题目地址:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1057&judgeId=605203 使用压位进行优化,即一位数存多位数,例如当设置MOD=1e8时,一位数可以存8位数; 其次,注意尾数0,因为压位,一位需要输出 阅读全文
posted @ 2018-08-13 22:01 liubilan 阅读(210) 评论(0) 推荐(0) 编辑
摘要:题目地址:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1021 经典区间dp,dp[i][j] 表示将从 i 到 j 堆石子合并最小代价,长度为 j-i+1,可看做之前已经合并的 i 到 k 和 k 到 j 两堆石子合并 阅读全文
posted @ 2018-08-13 15:58 liubilan 阅读(160) 评论(0) 推荐(0) 编辑
摘要:1001 degree 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6380 并查集向图中加点,分别记录与初始度数最多的点 直接相连的点数、独立的点数;则间接相连的点数 = n-1-直接相连的点数; 1004 p1m2 题目地址:http://acm 阅读全文
posted @ 2018-08-13 10:48 liubilan 阅读(218) 评论(0) 推荐(0) 编辑
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6375 Knowledge Point: STL - map:https://www.cnblogs.com/liubilan/p/9458765.html STL - deque:https://www 阅读全文
posted @ 2018-08-11 21:06 liubilan 阅读(327) 评论(0) 推荐(0) 编辑
摘要:题目地址:http://www.51cpc.com/web/problem.php?id=1581 Summarize: 1. 实质:计算5的个数(25 = 5*5,以此类推) 2. 层次累加计算 3. 数据范围 1 #include<iostream> 2 using namespace std; 阅读全文
posted @ 2018-07-25 15:34 liubilan 阅读(152) 评论(0) 推荐(0) 编辑

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