Cow Sorting
Time Limit: 2000MS | Memory Limit: 65536K | |
Total Submissions: 7455 | Accepted: 2926 |
Description
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 equipment, FJ would like to reorder the cows in line so they ar