摘要: ##问题描述 w*h的格子画了n条或垂直或水平宽度为1的直线,求出这些格子被划分成了多少个4连块(上、下、左、右连通)。 ##思路 挑战程序竞赛里面的题目,很容易想到的坐标离散化。因为直接搜索的话,我们可以想到有很多的空白行会造成我们资源的浪费。所以我们会直观的产生一种压缩的思想,去离散化出来一个等 阅读全文
posted @ 2020-06-12 23:25 Luglucky 阅读(310) 评论(0) 推荐(0) 编辑
摘要: ##LIS(最长上升子序列) LIS是动态规划里面的一个基础的问题,接下来我们讨论一下它的求法。 ###解一:暴力枚举 我们需要求的是不下降的子序列,所以朴素的想法,当我们面临a[i]的状态,我们可以从a[1]开始枚举元素,每次去判断这个元素是否小于a[i],如果小于那我们就可以更新dp[i]的值为 阅读全文
posted @ 2020-06-12 19:23 Luglucky 阅读(239) 评论(0) 推荐(0) 编辑
摘要: ##题目 Problem Description The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the 阅读全文
posted @ 2020-06-12 16:57 Luglucky 阅读(101) 评论(0) 推荐(0) 编辑
摘要: ##题面 Problem Description Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were 阅读全文
posted @ 2020-06-12 15:47 Luglucky 阅读(103) 评论(0) 推荐(0) 编辑