摘要: 题目传送门 1 /* 2 题意:有n个商店排成一条直线,有一些商店有先后顺序,问从0出发走到n+1最少的步数 3 贪心:对于区间被覆盖的点只进行一次计算,还有那些要往回走的区间步数*2,再加上原来最少要走n+1步就是答案了 4 详细解释:http://blog.csdn.ne... 阅读全文
posted @ 2015-06-07 18:35 Running_Time 阅读(264) 评论(0) 推荐(0)
摘要: 题目传送门 1 /* 2 模拟/字符串处理:主要是对*的处理,先把乘的预处理后再用加法,比如说是:1+2*3+4 = 1+..6+4 = 11 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include ... 阅读全文
posted @ 2015-06-07 18:29 Running_Time 阅读(221) 评论(0) 推荐(0)
摘要: 题目传送门 1 /* 2 贪心:按照0或1开头,若不符合,选择后面最近的进行交换。然后选取最少的交换次数 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #i... 阅读全文
posted @ 2015-06-07 18:25 Running_Time 阅读(253) 评论(0) 推荐(0)