贪心
julia7_
keep coding
展开
-
A1033 To Fill or Not to Fill (25 分)(加油站问题)(贪心)(难)
With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different ga...原创 2019-03-07 11:31:31 · 234 阅读 · 0 评论 -
A1067 Sort with Swap(0, i) (25 分)(贪心)
Given any permutation of the numbers {0, 1, 2,...,N−1}, it is easy to sort them in increasing order. But what ifSwap(0, *)is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2...原创 2019-01-25 13:06:09 · 518 阅读 · 0 评论 -
A1038 Recover the Smallest Number (30 分)(拼接出最小数字)(贪心)
Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229...原创 2019-01-25 13:36:18 · 321 阅读 · 0 评论