上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页
摘要: 题意 略 分析 因为字典序最小,所以从后面的列递推,每次对上一列的三个方向的行排序就能确保,数字之和最小DP就完事了 代码 因为有个地方数组名next和里面本身的某个东西冲突了,所以编译错了,后来改成nt就过了 include include include using namespace std; 阅读全文
posted @ 2018-10-17 11:30 ChunhaoMo 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 链接 [http://www.51nod.com/onlineJudge/questionCode.html problemId=1133&noticeId=468024] 题意 X轴上有N条线段,每条线段有1个起点S和终点E。最多能够选出多少条互不重叠的线段。(注:起点或终点重叠,不算重叠)。 例 阅读全文
posted @ 2018-10-17 11:09 ChunhaoMo 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 题意 给你n个区间,li ,ri,给你指定区间[s,t],求最少区间覆盖指定区间 分析 先对排序li,在对ri最大贪 代码 include using namespace std; define ll long long typedef pair pa; pair p[100010]; bool c 阅读全文
posted @ 2018-10-16 23:13 ChunhaoMo 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 链接 [http://acm.hdu.edu.cn/showproblem.php?pid=1342] 题意 分析 DFS 代码 include include int a[15],b[15],vis[15],k; void dfs(int ans,int num) { if(num==6) { f 阅读全文
posted @ 2018-10-16 23:01 ChunhaoMo 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 题意 分析 韦达定理 随便让(2+根号3)^n 和(2 根号3)^n 等于x1,x2我们得到一个方程 x^2 m x+1=0; 先判断是否有根,无根就没有解,有根就讨论一个根和两个根的情况 用求根公式求根,再用log函数求一下 代码 include using namespace std; defi 阅读全文
posted @ 2018-10-16 22:51 ChunhaoMo 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 题意 问题描述: 彭彭是个既漂亮又心肠好的女孩,她经营了一家礼品店,新年快来了,她想给她认识的所有小朋友们(很多很多)送些精美的小礼物,她的店中现在有K种一样大小的礼物,当然每种礼品的数量足够多,她还有一些礼品盒子,每个盒子均能盛放N个礼物。 彭彭想给每个小朋友不同的惊喜,因此她不允许任何两个盒子的 阅读全文
posted @ 2018-10-15 18:50 ChunhaoMo 阅读(121) 评论(0) 推荐(1) 编辑
摘要: 题意 给你三条边a,b,c问使得构成三角形,需要增加的最少长度是多少 思路 数学了啦 代码 include using namespace std; define ll long long int main(){ ios::sync_with_stdio(false); cin.tie(0); co 阅读全文
posted @ 2018-10-15 18:18 ChunhaoMo 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题意 给以一个字符串,让你重排列,使得回文子串的数目最多 分析 对于一个回文串,在其中加入一些字符并不会使回文子串的个数增加,所以对于相同的字符一起输出即可,我是直接排序 代码 阅读全文
posted @ 2018-10-15 18:16 ChunhaoMo 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 思路 打表找规律,发现结果是,2的(a二进制位为1总数)次方 代码 include using namespace std; define ll long long int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); l 阅读全文
posted @ 2018-10-15 18:12 ChunhaoMo 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 链接 [http://codeforces.com/contest/1065/problem/C] 题意 给你n个高度hi的塔,让你把高的部分切掉,使得最后所有塔一样高,而且每次切的高度之和不大于k 分析 从最高的塔,贪心地切到最低的塔,判断不大于k,即可 具体看代码 代码 include usin 阅读全文
posted @ 2018-10-15 18:08 ChunhaoMo 阅读(147) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页