摘要:
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1336There is an interesting calculator. It has 3 rows of buttons.Row 1: button 0, 1, 2, 3, ..., 9. Pressing each button appends that digit to the end of the display.Row 2: button +0, +1, +2, +3, ..., +9. Pressing each button adds that digit to the dis 阅读全文
摘要:
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1352题意:就是要将7 1 5 2这样的序列变成1 2 5 7最少需要多少步?给出变的规律,每次把最前面的那个数移动到比它次小的数的后面,要是它后面没有比它次小的数,就移动到最后,问最少需要多少步?For example, we will use 7 steps to sort the sequence 7 1 5 2: 7 1 5 2 --> 1 5 7 2 --> 5 7 2 1 --> 7 2 5 1 --> 2 5 7 1 --> 5 7 1 2 --> 阅读全文