POJ2013浅析------Symmetric Order

2013西北工业大学poj答案 2013年西北工业大学最新poj全套答案。欢迎下载。 立即下载
Symmetric Order
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 10108 Accepted: 6256

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

Source

Mid-Central USA 2004

 

 

题目类型:简单计算(太水!!!)

 

题目浅析:输入按奇偶性分开输出就行。

 

我的代码如下:

#include<stdio.h>
int main()
{
    int n,num=0,i;
    char a[20][30],b[20][30];
    while(scanf("%d",&n),n)
    {
        for(i=1;i<=n;i++)
            scanf("%s",a[i]);                  
        printf("SET %d\n",++num);
        for(i=1;i<=n;i++)
        {
            if(i%2==1)
                printf("%s\n",a[i]);                 
        }   
        for(i=n;i>=1;i--)
        {
            if(i%2==0)
                printf("%s\n",a[i]);                 
        }
    }
    return 0;    
}


 

 

通义千问对接FreeSWITCH实现大模型呼叫中心 通义千问是由阿里云开发的大规模语言模型,具备优秀的自然语言处理能力,支持文本生成、问答对话、摘要提取等多种任务。它不仅拥有丰富的知识储备,还能根据上下文灵活调整回答策略,适用于各种复杂场景下的自动化交流。FreeSWITCH是一个开源的多媒体通信服务器,提供了包括VoIP通话、即时消息传递在内的多种通信服务。它的模块化设计允许开发者根据实际需求定制功能,广泛应用于企业级通信系统中。通过集成通义千问,FreeSWITCH能够实现更智能的客户服务体验。 阅读详情

相关推荐

摩尔线程GPU实战:5分钟搞定AI模型部署(含Docker避坑指南)

本文详细介绍了摩尔线程GPU在AI模型部署中的实战应用,包括环境配置、Docker避坑指南及性能优化技巧。通过5分钟快速部署指南,帮助开发者高效利用摩尔线程GPU进行AI模型推理,特别针对常见兼容性问题提供解决方案,显著提升部署效率。

weixin_28736335的博客 454

对称排序(包含结构体,以及sort中的comp,字符串数组,以及字符串数组按长度排序等内容)

对称排序时间限制:1000 ms  |  内存限制:65535 KB难度:1描述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 non...

婳儿的博客 497

康耐视 VisionPro CogImageFileTool(将获得的图像保存至文件或从文件中获取图像)工具

VisionPro CogImageFileTool(将获得的图像保存至文件或从文件中获取图像)工具

zhihuishuxia__的博客 2064

Symmetric Order

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). Howe

weixin_46011385的博客 327

FPGA实战:手把手教你实现雷达信号数字下变频(DDC)完整流程

本文提供了一份完整的FPGA实现雷达信号数字下变频(DDC)的实战指南。内容涵盖从Matlab行为级仿真到FPGA硬件实现的完整闭环流程,详细讲解了数字混频、滤波、抽取等核心步骤,并分享了基于Vivado的IP核配置、数据位宽量化及资源优化等关键工程实践经验,旨在帮助读者掌握DDC系统的硬件实现与调试。

dog123的博客 342

Qt Design Studio 入门指南:从零开始打造炫酷UI(详细+实用+轻松上手)

本文是Qt Design Studio的详细入门指南,旨在帮助UI设计新手从零开始轻松打造炫酷界面。文章系统介绍了软件的核心概念、安装步骤、主界面解析,并通过创建一个完整的登录界面实例,手把手教学如何拖拽组件、设置属性、添加交互状态与动画。同时,分享了创建自定义组件、管理资源以及提升效率的实用技巧与常见问题解决方案,让读者能够快速上手并应用于实际项目开发。

devops8pract的博客 588

Symmetric Order——(第一场 递归与回溯)

链接:https://ac.nowcoder.com/acm/problem/106610 来源:牛客网 在信天翁马戏团管理公司(是的,它是由一群小丑运行的)的工作中,你刚刚完成了一个程序,它的输出是按长度顺序排列的名称列表(这样每个名称至少与前面的名称一样长)。但是,你的老板不喜欢输出的样子,相反,希望输出看起来更对称,顶部和底部的字符串越短,中间的字符串越长。他的规则是,每对名字都属于列表的两端,而这对名字中的第一个总是在列表的顶部。在下面的第一个例子中,Bo和Pat是第一对,

iuk11的博客 291

Unity 工具 之 ZXing QRCode 二维码的生成和识别(可设置生成不同颜色的/带图标的二维码)

Unity 基础 之 ZXing QRCode 二维码的生成和识别(可设置生成不同颜色的/带图标的二维码) 目录 Unity 基础 之 ZXing QRCode 二维码的生成和识别(可设置生成不同颜色的/带图标的二维码) 一、简单介绍 二、实现原理 三、注意实现 四、效果预览 五、ZXing.net ( zxing.unity.dll ) 插件下载 六、实现步骤 七、关键代码 一、简单介绍 Unity 开发中,自己整理的一些游戏开发可能用到的功能,整理归档,方便游...

仙魁XAN 9824

poj 2013 Symmetric Order

poj 2013 Symmetric Order 1. 简单题,故意用了栈,另外从这个题上可以体会到OJ判题模式 #include <iostream> #include <cstdio> #include <stac...

dayong9372的博客 189

(王道计算机组成原理笔记)第一章计算机系统概述-第二节:计算机系统层次结构 1(计算机系统组成、计算机硬件)

文章目录一:冯诺依曼体系结构(1)存储程序计算机(2)层次结构二:计算机硬件概述(1)存储器A:存储元、存储单元、存储体、存储字和存储字长B:MAR 一:冯诺依曼体系结构 在冯诺依曼体系结构中,计算机的硬件主要有**存储器,运算器,控制器,输入和输出设备(也叫做I/O设备)**组成。 (1)存储程序计算机 冯诺依曼体系结构也叫做存储程序计算机,计算器和计算机的唯一区别就是计算器是不能编程的,只能做电路板中设定好的固定的运算。 这也就意味着计算器本质就是一个不能编程的计算机,其在硬件层面已经将逻辑写死,如果

快乐江湖的博客 1万+

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory解决方案

本文主要介绍了ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory解决方案,希望能对使用Python的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 11万+

POJ2013 Symmetric Order(继续我的水题之路)

【题意简述】:这个题意描述很简单,看输入输出就可以了。 【分析】:还是刷水题心情好点~ 不过,不知为什么我的代码,G++过了,而C++却CE。// 748K 16Ms #include #include using namespace std; #include string cha[26]; string cha1[26],cha2[26]; int main() { int n;

坚持 1019

Python爬虫实战:爬取Bilibili和YouTube视频、弹幕和评论

随着视频内容平台的爆发式增长,视频网站成为了人们获取信息、娱乐和知识的重要渠道。在这些平台上,视频、弹幕和评论数据可以为我们提供重要的信息,帮助我们了解用户的行为、视频的受欢迎程度以及内容的互动情况。本篇文章将带你实现一个Python爬虫,用来爬取Bilibili和YouTube上的视频、弹幕、评论等数据。我们将详细介绍爬虫的实现过程,使用最新的Python技术,并且会提供完整的代码。Bilibili网站提供了多种方式来获取视频数据,最直接的方式是通过其开放的API接口来获取视频、弹幕和评论等数据。

2201_76125261的博客 1775

POJ-2013

#include #include #include #include #include #include using namespace std; int main(int argc, char *argv[]){ int num; int caseNum=0; while(cin>>num,num){ caseNum++; multimap mInput; for(int

eddy_liu的专栏 386

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Symmetric Order(POJ-2013)

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 clowns), you have just finished writing a program whos...

Struggle_0的博客 441

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

POJ - 2013 Symmetric Order (java)

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). Howe

昔年 ~ 不忆的博客 270

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

对称排序 26

对称排序 描述 Inyour 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 innondescending order by length (so th

程序圆—脱颖而出,卓尔不群 774

POJ 2013 - Symmetric Order

Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 12125   Accepted: 7357 Description In your job at Albatross Circus Management (yes, it's run by a bunch of clowns), yo

Latte_z的小站 674

2172_Symmetric Order(水题)

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

李松雨的专栏 995

对称排序

描述 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

Jingle的博客 682

B - Symmetric Order(3.3.1)

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 lengt

Shawn Hou 834

NYOJ 283 对称排序

对称排序时间限制:1000 ms  |  内存限制:65535 KB难度:1描述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 non...

一只立志做最大的咸鱼又不想做咸鱼的小弱鸡 476

Symmetric Order(Java)

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...

Medlen 381

NYOJ-283-对称排序-2013年11月5日22:11:16

对称排序 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 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 li

程序员充电站(itcharge) 1536

nyoj 283 对称排序

对称排序 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 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

莫道青天真无道,能逍遥时且逍遥! 1376

(简单递归3.3.1)POJ 2013 Symmetric Order(对称输出)

/* * POJ_2013.cpp * * Created on: 2013年10月24日 * Author: Administrator */ #include #include //要使用cin >> s;则要加上这一句,否则可能出错 using namespace std; void print(int n){ string s; cin >> s;//输入

黄俊东的专栏 1674
上一篇: POJ2000浅析------Gold Coins
下一篇: POJ2014浅析------Flow Layout
monkey7777
博客等级 码龄15年 55粉丝 104原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值