摘要: 简单贪心。问题等价于给你n个区间,选择最少数量的区间,使这些选出来的区间覆盖住[1,n]。 #include<cstdio> #include<cstring> #include<cmath> #include<stack> #include<algorithm> using namespace s 阅读全文
posted @ 2016-03-10 20:24 Fighting_Heart 阅读(136) 评论(0) 推荐(0)
摘要: 简单贪心。注意输出格式,每到80个字符就换一行。 #include<cstdio> #include<cstring> #include<cmath> #include<stack> #include<algorithm> using namespace std; const int maxn = 阅读全文
posted @ 2016-03-10 19:31 Fighting_Heart 阅读(175) 评论(0) 推荐(0)
摘要: 蚂蚁掉头等于不掉头。 #include<cstdio> #include<cstring> #include<cmath> #include<stack> #include<algorithm> using namespace std; const int maxn=1000000+10; int 阅读全文
posted @ 2016-03-10 19:07 Fighting_Heart 阅读(164) 评论(0) 推荐(0)
摘要: 双塔DP+输出路径。 由于内存限制,DP只能开滚动数组来记录。 我的写法比较渣,但是POJ能AC,但是ZOJ依旧MLE,更加奇怪的是Uva上无论怎么改都是WA,其他人POJ过的交到Uva也是WA。 #include<cstdio> #include<cstring> #include<cmath> 阅读全文
posted @ 2016-03-10 12:09 Fighting_Heart 阅读(198) 评论(0) 推荐(0)