摘要: A题: *题目描述: 给你一个1~n的排列,问只交换一次后,1和n距离的最大值。 *题解: 贪心。把1或n交换到最旁边肯定是最优的。 *代码: #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #if 阅读全文
posted @ 2016-06-14 19:23 cot 阅读(185) 评论(0) 推荐(0)