摘要: 地址:http://hustoj.sinaapp.com/problem.php?id=1839将乱序的数列中的元素两两交换,变成升序数列,输出所需最小步骤数其实就是模拟一个过程,只有三种数,先是找只需交换一次便归位的,然后是交换两次三个数归位的,交换时计数就行 1 #include <iostream> 2 #include <algorithm> 3 #include <vector> 4 5 using namespace std; 6 vector<int> num,con(4); 7 int n,con_num; 8 9 void sw 阅读全文
posted @ 2013-03-09 19:08 tjsuhst 阅读(320) 评论(0) 推荐(0) 编辑