Description
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
7 Bo Pat Jean Kevin Claude William Marybeth 6 Jim Ben Zoe Joey Frederick Annabelle 5 John Bill Fran Stan Cece 0
Sample Output
SET 1 Bo Jean Claude Marybeth William Kevin Pat SET 2 Jim Zoe Frederick Annabelle Joey Ben SET 3 John Fran Cece Stan Bill
关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率
首页/
已采纳
Symmetric Order
收起
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 微信扫一扫点击复制链接分享
- 邀请回答
- 编辑 收藏 删除 结题
- 收藏 举报
追加酬金 (90%的用户在追加酬金后获得了解决方案)
当前问题酬金
¥ 0 (可追加 ¥500)
¥ 15¥ 20¥ 50¥ 100¥ 200
支付方式
扫码支付
二维码出错
点击刷新
点击刷新
2条回答 默认 最新
- 关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率
threenewbee 2017-11-05 01:42关注本回答被题主选为最佳回答 , 对您是否有帮助呢? 本回答被专家选为最佳回答 , 对您是否有帮助呢? 本回答被题主和专家选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏举报微信扫一扫点击复制链接分享编辑预览轻敲空格完成输入- 显示为
- 卡片
- 标题
- 链接
评论按下Enter换行,Ctrl+Enter发表内容
编辑
预览
轻敲空格完成输入
- 显示为
- 卡片
- 标题
- 链接
报告相同问题?
提交
- 2017-07-27 01:17回答 2 已采纳 http://blog.csdn.net/u013009575/article/details/19170609
- 2017-02-14 23:42回答 2 已采纳 http://blog.csdn.net/qq397470071/article/details/10416369
- 2017-05-13 08:36回答 1 已采纳 http://www.genshuixue.com/tiku/8hm2il0693km62m53mm90j4lij3lh986.html
- 2020-11-01 06:23Moon Chair Blade的博客 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 ...
- 2017-04-26 00:54回答 1 已采纳 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1203
- 2017-06-24 07:28回答 1 已采纳 http://www.shangxueba.com/jingyan/1825910.html
- 2020-07-17 16:02猫的旅途的博客 Symmetric Order Time Limit:1000MS Memory Limit:30000K Total Submissions:16689 Accepted:9497 Description In your job at Albatross Circus Management (yes, it's run by a bunch of ...
- 2019-03-05 14:08wflora0114的博客 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 ...
- 2019-09-01 09:15GLOW444的博客 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 (...
- 2020-07-17 10:53Wings_of_freedom的博客 写之前: 这道题其实弱鸡的我没有用dfs,就直接写下来了,也许是我很弱吧!! 题目大意: 题意:将原来非降序的一组名字按对称的顺序输出,具体为:(数组下标从1开始)先奇数升序的输出,然后偶数降序输出 ...
- 2015-08-15 14:10ACMer_Shadow的博客 Symmetric Order Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 42 Accepted Submission(s) : 12 Problem Description In your job at Albatros
- 2018-09-03 01:05Medlen的博客 Symmetric Order Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14750 Accepted: 8722 Description In your job at Albatross Circus Management (yes, it’s run by a bunch of clow...
- 2020-07-27 07:07iuk11的博客 在信天翁马戏团管理公司(是的,它是由一群小丑运行的)的工作中,你刚刚完成了一个程序,它的输出是按长度顺序排列的名称列表(这样每个名称至少与前面的名称一样长)。但是,你的老板不喜欢输出的样子,相反,希望...
- 2017-02-27 17:21「已注销」的博客 Problem hereSolution#include #include #include using namespace std;vector<string> strs; int n, cnt = 0;void solve(int a, int b){ if(b == strs.size() || a == strs.size()
- 2017-04-06 14:01woniupengpeng的博客 #include #include #include #include //谢谢博友翻译 using namespace std; int main() { vector gs; vector jg; while(1) { int NUM; cin>>NUM; if(NUM==0) { break;... in
- 2016-03-27 11:56暮雨rainy的博客 题目链接 水题,奇数行和偶数行分别输出即可#include #include #include #include using namespace std; int main() { string odd[9]; string even[9]; int num,n=0,set=0; while
- 2020-08-24 07:03温柔说给风的博客 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 ...
- 2019-10-02 17:00dayong9372的博客 poj 2013 Symmetric Order 1. 简单题,故意用了栈,另外从这个题上可以体会到OJ判题模式 #include <iostream> #include <cstdio> #include <stac...
- 没有解决我的问题, 去提问
悬赏问题
- ¥15 VAE代码如何画混淆矩阵
- ¥15 求遗传算法GAMS代码
- ¥15 雄安新区高光谱数据集的下载网址打不开
- ¥66 android运行时native和graphics内存详细信息获取
- ¥100 求一个c#通过CH341读取数据的Demo,能够读取指定地址值的功能
- ¥15 rk3566 Android11 USB摄像头 微信
- ¥15 torch框架下的强化学习DQN训练奖励值浮动过低,希望指导如何调整
- ¥35 西门子博图v16安装密钥提示CryptAcquireContext MS_DEF_PROV Error of containger opening
- ¥15 mes系统扫码追溯功能
- ¥40 selenium访问信用中国
联系我们(工作时间:8:30-22:00)
400-660-0108kefu@csdn.net在线客服
- 京ICP备19004658号
- 经营性网站备案信息
- 公安备案号11010502030143
- 营业执照
- 北京互联网违法和不良信息举报中心
- 家长监护
- 中国互联网举报中心
- 网络110报警服务
- Chrome商店下载
- 账号管理规范
- 版权与免责声明
- 版权申诉
- 出版物许可证
- ©1999-2025北京创新乐知网络技术有限公司