土拨鼠的数字环
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
故事背景
土拨鼠——佳佳 捡到了一个神奇的数字环,于是玩弄起它来。
题目描述
佳佳 想把这个数字环给剪成一条链,使得这条链上的数字最大。因为 佳佳 只能剪一次,它想请你帮忙剪这个数字环,并告诉它这个数字链上的组成数字最大是多少。
格式
输入(number.in)
第一行一个整数,表示这个数字环的长度。保证为偶数。
接下来是行,每行包含2个整数。这几行的数据表示的是这个数字环。保证数字环上的每个数都是一位数。
输出(number.out)
将这个数字环剪开后,这个数字链最大是多少。
样例
10
1 6
2 7
3 8
4 9
5 0
9876123450
【样例1】说明:
数字环:
剪开:
从这里剪开
8
9 8
9 8
9 0
2 1
99988012
提示
保证为偶数
文件重定向:number.in number.out
Hello world
- Status
- Done
- Rule
- IOI
- Problem
- 5
- Start at
- 2022-12-2 18:00
- End at
- 2023-1-1 0:00
- Duration
- 702 hour(s)
- Host
- Partic.
- 4