2014 winter acm 3 c
来源:互联网 发布:mac魔兽世界闪退 编辑:程序博客网 时间:2024/06/01 21:18
C
Submitted : 23, Accepted : 17
In your job at Albatross Circus Management (yes, it's run by a bunch of clowns), you have just finished writing a program whose output is a list of names in nondescending order by length (so that each name is at least as long as the one preceding it). However, your boss does not like the way the output looks, and instead wants the output to appear more symmetric, with the shorter strings at the top and bottom and the longer strings in the middle. His rule is that each pair of names belongs on opposite ends of the list, and the first name in the pair is always in the top part of the list. In the first example set below, Bo and Pat are the first pair, Jean and Kevin the second pair, etc.
Input
The input consists of one or more sets of strings, followed by a final line containing only the value 0. Each set starts with a line containing an integer, n, which is the number of strings in the set, followed by n strings, one per line, sorted in nondescending order by length. None of the strings contain spaces. There is at least one and no more than 15 strings per set. Each string is at most 25 characters long.
Output
For each input set print "SET n on a line, where n starts at 1, followed by the output set as shown in the sample output.
Sample Input
7BoPatJeanKevinClaudeWilliamMarybeth6JimBenZoeJoeyFrederickAnnabelle5JohnBillFranStanCece0Sample Output
SET 1BoJeanClaudeMarybethWilliamKevinPatSET 2JimZoeFrederickAnnabelleJoeyBenSET 3JohnFranCeceStanBill
- 2014 winter acm 3 c
- 2014 Winter Vacation Practice No.3 Translation
- winter
- 2013-2014 This Winter vacation
- HOJ 2014 winter 转16进制
- 2014 Winter Vacation Practice No.2 Translation
- SZU 2015 Winter Training Day#3
- acm - 1640. Circle of Winter 最为简单的形式- 构造解 非最优解
- Altium Designer Winter 09 PCB 3D 自我总结
- Winter Break
- CS 231A CV(winter 2014) problem set 3第一题第三小题(给定关键点及边框寻找最优边框)
- [最大密度子图 最小割] ACM 2014 Xian C The Problem Needs 3D Arrays
- ACM c函数大全
- C++/ACM/数据结构/算法
- ACM Problem C
- ACM常用c库函数
- c语言函数(acm)
- ACM-problem C
- Google lmctfy 3.2 - Example allocate memory in container
- Node.JS + MongoDB技术讲座
- 网站优化外链建设的误区与解决方法
- Floating point exception
- ios 地理信息反编码
- 2014 winter acm 3 c
- java web項目 物理路徑
- 攻击JavaWeb应用[9]-Server篇[2]
- Hadoop--异常java.io.EOFException
- django学习记录-RequestContext
- java退出执行addShutdownHook
- hdu1240、hdu1253(三维搜索题)
- 我的2014年的任务
- 软件开发的生命线——文档