摘要: http://poj.org/problem?id=1208 晚点仔细看 https://blog.csdn.net/yxz8102/article/details/53098575 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h 阅读全文
posted @ 2019-01-20 15:26 XXrl 阅读(225) 评论(2) 推荐(1) 编辑
摘要: https://vjudge.net/problem/UVA-10474 https://blog.csdn.net/xiyaozhe/article/details/81081344 简单用法 sort(start,end) 默认是升序 实现降序: #include <functional> in 阅读全文
posted @ 2019-01-20 13:05 XXrl 阅读(141) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1240 行列不重复-->每一列放置的种类数跟前一列有关(递推)-->镜面和旋转的情况属于不同的方案-->按每列长度从小到大排-->得到第(2*i-1)和第(2*i)列长度相同,第(2*n-1)列长度最长且唯一,奇数列长度 阅读全文
posted @ 2019-01-16 20:31 XXrl 阅读(202) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1226 快速幂和取余性质学习了题解。 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #includ 阅读全文
posted @ 2019-01-12 16:36 XXrl 阅读(219) 评论(0) 推荐(1) 编辑
摘要: https://www.luogu.org/problemnew/show/P1216 从底往上推,每一个记录的都是下面两个中最大的路径和。 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstrin 阅读全文
posted @ 2019-01-12 14:11 XXrl 阅读(137) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1113 用DP来写,下次加拓扑 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #include<c 阅读全文
posted @ 2019-01-08 11:44 XXrl 阅读(157) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/team/show?teamid=2961 由普通汉诺塔问题,设数量为n时移动次数为a[n],则a[n]=a[n-1]+1+a[n-1]=2*a[n-1]+1. // 因为a[1]=1,所以a[n]=2^n-1.(找规律?) 故双塔就是2*(2^n-1). 阅读全文
posted @ 2019-01-05 17:31 XXrl 阅读(704) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1044 1.用dfs来做,记录以备用 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #includ 阅读全文
posted @ 2019-01-05 14:35 XXrl 阅读(172) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problemnew/show/P1007 不用考虑七七八八的换头,每个士兵其实都是一样的,所以当他们遇见时,就当直接传过去||或者灵魂交换。//哈哈,喜欢这种高空俯视视角。 所以就直接求向左走和向右走的最大小值就行 1 #include<iostream 阅读全文
posted @ 2018-12-29 20:40 XXrl 阅读(149) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2955 类似hdu1203 也是概率题 只需知道 p逃走=1-p抓住 所以先算出每个钱数所代表的最大逃走概率,在最后跟 1-m 比较 1 #include<iostream> 2 #include<algorith 阅读全文
posted @ 2018-12-27 20:57 XXrl 阅读(103) 评论(0) 推荐(0) 编辑