本文转载至:http://rts.lab.asu.edu/web_438/CSE438_Main_page.htm Thecourse provides the opportunities for students to learn various fundamentalissues as well as practical developments in the area of embed
B. Minimize the Permutation 飞机票 题意: 给你从1-n的全排列,每个位置有且只能进行一次置换,置换是当前位置和下一位置交换,求能得到的字典序最小的全排列是什么,输出它 思路: 贪心的去思考,既然要全排列最小,那么肯定是在能交换的情况下对数列中最小的数进行交换放在当前位置,又因为数据范围很小,于是我用flag标机当前位置,用map记录每个数的位置,暴力的去扫1-n中