
置换
coldfresh
那我们开始吧
展开
-
Cow Sorting POJ - 3270 (置换)
Farmer John’s N (1 ≤ N ≤ 10,000) cows are lined up to be milked in the evening. Each cow has a unique “grumpiness” level in the range 1…100,000. Since grumpy cows are more likely to damage FJ’s milking原创 2017-07-28 20:32:39 · 361 阅读 · 0 评论 -
Leonardo's Notebook POJ - 3128(置换群的开方判断)
— I just bought Leonardo’s secret notebook! Rare object collector Stan Ucker was really agitated but his friend, special investigator Sarah Kepticwas unimpressed. — How do you know it is genuine? ...原创 2018-03-28 21:50:55 · 325 阅读 · 0 评论 -
【51nod 1125】 交换机器的最小代价 (置换、贪心)
基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 有N台机器重量各不相等,现在要求把这些机器按照重量排序,重量从左到右依次递增。移动机器只能做交换操作,但交换机器要花费一定的费用,费用的大小就是交换机器重量的和。例如:3 2 1,交换1 3后为递增排序,总的交换代价为4。给出N台机器的重量,求将所有机器变为有序的最小代价。(机器的重量均为正整数) Input...原创 2018-09-06 15:18:28 · 430 阅读 · 0 评论