hdu Problem-5702(结构体排序)

overleaf 支持中文 在overleaf上使用ctex + 中文。应该设置。示例。 阅读详情

Solving Order

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1306    Accepted Submission(s): 859


Problem Description
Welcome to HDU to take part in the first CCPC girls' competition!



As a pretty special competition, many volunteers are preparing for it with high enthusiasm.
One thing they need to do is blowing the balloons.

Before sitting down and starting the competition, you have just passed by the room where the boys are blowing the balloons. And you have found that the number of balloons of different colors are strictly different.

After thinking about the volunteer boys' sincere facial expressions, you noticed that, the problem with more balloon numbers are sure to be easier to solve.

Now, you have recalled how many balloons are there of each color.
Please output the solving order you need to choose in order to finish the problems from easy to hard.
You should print the colors to represent the problems.
 

Input
The first line is an integer T which indicates the case number.
And as for each case, the first line is an integer n, which is the number of problems.
Then there are n lines followed, with a string and an integer in each line, in the i-th line, the string means the color of ballon for the i-th problem, and the integer means the ballon numbers.

It is guaranteed that:
T is about 100.
1≤n≤10.
1≤ string length ≤10.
1≤ bolloon numbers ≤83.(there are 83 teams :p)
For any two problems, their corresponding colors are different.
For any two kinds of balloons, their numbers are different.
 

Output
For each case, you need to output a single line.
There should be n strings in the line representing the solving order you choose.
Please make sure that there is only a blank between every two strings, and there is no extra blank.
 

Sample Input
3 3 red 1 green 2 yellow 3 1 blue 83 2 red 2 white 1
 

Sample Output
yellow green red blue red white



//思路:结构体排序,但是我PE了几次,最后一组数据也要换行!!!


AC源码:

#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

#define LO
struct balloon
{
	string col;
	int n;
	balloon(string a,int b):col(a),n(b){}
	bool operator<(const balloon& rhs)
	{
		return n>rhs.n;
	}
};

vector<balloon> bvec;
int main()
{
#ifdef LOCAL
	freopen("data.in","r",stdin);
	freopen("data.out","w",stdout);
#endif
	int T;
	cin>>T;
	while(T--)
	{	
		bvec.clear();
		int n;
		cin>>n;
		string a;
		int num;
		while(n--)
		{
			cin>>a>>num;
			bvec.push_back(balloon(a,num));
		}
		sort(bvec.begin(),bvec.end());
		int ok=1;
		for(int i=0;i<bvec.size();++i)
		{
			if(ok)
			{
				cout<<bvec[i].col;
				ok=0;	
			}
			else
				cout<<' '<<bvec[i].col;
		}
		cout<<endl;
	}
	return 0;
}



如何使用 Overleaf 编写 LaTeX 文档 Overleaf 是一个强大而方便的在线 LaTeX 编辑器,它可以让你轻松地创建和共享 LaTeX 文档,无需安装任何软件或插件。如果这篇文章对您有帮助,请点个小赞吧,愿能与诸君共同进步! 阅读详情

相关推荐

无涯教程-Latex Overleaf

Latex是一种免费的数学排版软件,可以通过多种方式获得。这里使用的Overleaf是基于云的系统,我们可以在其中在线进行文字处理,并可以下载PDF格式的输出文件。让我们从下页开始。步骤如下:1)打开浏览器或任何搜索引擎,然后输入。2)该页面将打开,如下图所示:3)根据您的要求单击注册选项。注册选项将如下图所示:4)注册后,将出现下页屏幕。点击""选项。一旦您单击"新项目"?选项,将显示下拉列表。您可以从下拉列表中选择所需的文档格式。

无涯教程 1227

【LaTeX】3在Overleaf中解决IEEE LaTeX模板不能显示中文问题

CTeX是一个针对中文排版优化的LaTeX宏集,它提供了完善的中文支持,包括字体选择、文本排版、以及和其他宏包的兼容性。在开始解决方案之前,确保你的Overleaf项目设置正确,特别是编译器选择(例如XeLaTeX或LuaLaTeX),这些编译器天然支持UTF-8编码,更适合处理中文。通过以上步骤,可以有效解决在Overleaf中使用IEEE LaTeX模板时的中文显示问题,从而顺利完成中文学术文档的编写和提交。Overleaf默认支持的是英文文档写作,如写的中文“你的名字”,在编译后没有显示出来。

定期分享我的发现和想法,感谢你的陪伴和支持 1万+

Overleaf中精准控制中英混排:XeLaTeX与ctex的高级配置技巧

本文详细解析了在Overleaf中实现中英混排排版的核心技巧。针对默认PDFLaTeX编译器不支持UTF-8编码导致中文编译失败的问题,文章指出切换至XeLaTeX或LuaLaTeX是基础前提。重点阐述了如何通过配置ctex宏包的关键参数(如scheme=plain, punct=plain),在保留英文文档原有样式(字体、编号、标点)的前提下,精准、无干扰地插入和排版中文内容,并提供了可直接复用的Overleaf项目模板。

tomato的博客 1055

Overleaf使用自定义中文字体

在Overleaf中使用自己上传的中文字体。

weixin_44221085的博客 1万+

5分钟搞懂SCMA:稀疏码多址接入的核心原理与实战应用

本文深入浅出地解析了SCMA(稀疏码多址接入)的核心原理与实战应用。通过对比传统正交多址技术,阐释了SCMA如何通过非正交叠加和稀疏码本设计,实现远超资源单元数的用户接入,从而有效应对5G海量机器通信(mMTC)的挑战。文章还探讨了其在上行海量连接、免授权接入等场景的应用潜力及工程实现中的关键考量。

zeta9的博客 264

【AIGC】COT思维链:让AI学会拆解问题,像人一样思考

COT思维链的出现,为AI的发展开辟了一条新的道路。它让AI学会了像人类一样思考,将复杂问题分解成简单的步骤,并逐步推理出最终答案。希望我的引导会对你产生启发。

智兔唯新的博客 9002

利用Overleaf使用Latex插入算法伪代码

我们使用的是Overleaf, 在线LaTeX编辑器进行编写,在项目的菜单中选择XeLaTeX编译器。 这句代码表示引用宏包algorithm2e 下面是它的一些常用参数介绍参数作用linesnumbered显示行号ruled标题显示在上方,不加就默认显示在下方vlined代码段中用线连接boxed将算法插入在一个盒子里基本语法代码作用\;行末添加行号并自动换行\caption{算法名称}插入算法名称\KwData输入信息}显示“Data:输入信息”\KwIn{输入信息}显示“Input

知识搬运者 2万+

Cadence SpectreRF仿真避坑指南:PSS和Pnoise设置详解(附实战案例)

本文详细解析了Cadence SpectreRF中PSS(周期稳态分析)和Pnoise(周期噪声分析)的关键设置技巧,帮助模拟IC设计工程师避开常见仿真陷阱。通过实战案例分享,涵盖引擎选择、Beat Frequency计算、噪声类型配置等核心参数优化策略,提升仿真精度与效率。特别针对开关电容电路和振荡器等复杂场景提供专业解决方案。

weixin_42613501的博客 601

HDOJ--5702--Solving Order

题目描述: As a pretty special competition, many volunteers are preparing for it with high enthusiasm. One thing they need to do is blowing the balloons. Before sitting down and starting the competition, y...

猩猩是个好程序员的博客 193

Python、Selenium实现问卷星自动填写(内含适配个人问卷的方法)

使用Python、Selenium实现问卷星自动填写,内含适配个人问卷的方法。

DaenCode的博客 3836

UE4 Instanced Mesh 半透明渲染顺序不对解决

以绿色方块为Instanced Mesh为例。 正确的半透应该是这样的: 这是一般蓝图Actor方块,其半透是正常的。 然而Instanced Mesh因为过多,UE4不给你缓存正确的渲染顺序。所以,在不改代码的情况下,想解决Instanced Mesh半透问题,是不可能的。不正确的半透如下: 注意到错误发生在Instanced Mesh的方块与方块之间。 但我就是要解决,...

qq_41524721的博客 5569

overleaf的使用[10]:使用LaTeX进行中文支持

老鸟:首先,我们需要在文档的导言区(即之前)加载几个关键的宏包。最常用的两个宏包是ctex和xeCJK。我们先从ctex开始吧。菜鸟:好的,那这个ctex包怎么用呢?老鸟你好,世界!菜鸟:哦,原来这么简单!那xeCJK呢?老鸟xeCJK需要你使用 XeLaTeX 编译器,而不是默认的 PDFLaTeX。这个包的好处是它可以更灵活地处理中英混排。\setCJKmainfont{SimSun} % 这里指定中文字体你好,世界!菜鸟:那这个SimSun是什么?老鸟SimSun是宋体字体。

刘炫320的博客 2456

28-基于STM32单片机的便携式健康监测系统设计与实现(程序+原理图+元件清单)

本文详细介绍了基于STM32单片机的便携式健康监测系统设计与实现,该系统集成MAX30102光电传感器和MSP20压力传感器,实时监测心率、血氧和血压等关键生理指标。通过STM32F103C8T6主控芯片和HC-05蓝牙模块,实现数据采集、处理及无线传输,具有便携性高、操作简便等特点,适用于家庭健康监护和户外运动场景。

weixin_29191669的博客 420

overleaf的中文设置

在overleaf中新建一个文件之后,左上角的菜单->编辑器->Xelatex的编译方式进行编译,选择使用宏包\usepackage[utf8]{ctex}进行设置中文。

mooc666quq的博客 8082

出现 has been blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header is present on the 解决方法

Access to XMLHttpRequest at 'http://127.0.0.1:5000/api/data' from origin 'http://10.197.0.79:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

码农研究僧的博客 1万+

vue2/3 - element表格组件el-table实现懒加载树型(上下级)数据、默认展开和隐藏层级,支持对表格进行修改|新增|删除,解决完成操作后树节点不刷新问题(提供示例代码,一键复制开箱即用

vue2,vue3,elementui,elementPlus,el-table,Table表格组件,表格懒加载数据,element table表格数中的树形结构懒加载,增加后数据不同步更新问题,el-table树形与el-tree树形结构的一键折叠与展开,elementui中el-tree懒加载数据 默认展开最外层节点,Element-plus Table组件树表结构默认展开一级目录,vue实现element table表格树形结构-使用懒加载时-解决子节点增删改后,不刷新子节点数据问题,解决el-tre

✅ 精选推荐文章 1万+

overleaf基础入门

overleaf学习overleaf 入门latex常用语法数学公式中文编译overleaf 开源字体其他小的注意点LATEX的构造类型分类常见环境交叉引用 cross-referencing加入插图插入表格数学公式引用文献 学习视频 overleaf 入门 latex常用语法 格式 效果 overleaf快捷键 \textbf 加粗 ctrl+b \emph 斜体、强调 \textit 斜体 ctrl+i \section 生成章节,会自动编号 \subsection

Junewang0614的博客 1万+

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

2016女生赛 1001 Solving Order

Solving Order Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Welcome to HDU to

Puya的博客 862

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

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

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

基于overleaf的LaTex学习与使用

在设置这里切换编译器complier至XeLaTex。然后再文章中加入语句即可。首先在项目的左上角点击菜单。

m0_67173953的博客 650

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Latex(overleaf)–用ctexset重定义标题

Latex(overleaf)–用ctexset重定义标题 Latex(overleaf)–用ctexset重定义标题 在使用latex或者线上的overleaf进行毕业论文撰写时,常常需要重定义各级标题的格式,用\CTEXsetup会出现警告Package ctex Warning: Command `\CTEXsetup’ is deprecated: Package ctex Warning: Command `\CTEXsetup' is deprecated. \ctexset { chapter

hyj0000的博客 9761

2022.12 Latex使用小结(Overleaf篇)

一些overleaf使用小结

c271441的博客 1万+

hdu4486 Pen Counts(水题)

Pen Counts Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 224    Accepted Submission(s): 127 Problem Description Chicken farmer Xi

小爱的专栏 2288

ACM HDU 1070 Milk

Milk Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5689    Accepted Submission(s): 1291 Problem Description Ignatius drinks milk everyday, ...

weixin_33979745的博客 247

HDU 水题十道,慢慢品味

转载自:提高鸟语能力~~ 1 hdu 1032 [cpp] view plain copy  print? #include    using namespace std;      int len(int n)   {       int s  = 1;       while (n!=1)       {       

Singular__point的博客 628

hdu4152 二进制枚举

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4152/* 4 100 200 300 400 3 100 100 400 500 100 -10 50 300 100 100 -50 -50 */ #include int goal[30]; int f[25][25],g[30]; main(){ int i,j,n,m,ans1,ans...

智浩的博客 447

介绍Latex神器——Overleaf的方法

向大家介绍2个神网站,一个是腾讯在线文档,一个是overleaf 腾讯在线文档就不多介绍了,可以直接百度网址并使用,它有2个亮点,1.特别简洁,高效。2.可以多人在线,共同编辑同一个文档。(在笔者参加研究生数学建模的时候,三个队员编辑同一篇论文,非常有效果!) ----------------------------------------------------------------...

张凡的博客 14万+
上一篇: UVa1395(最小值最小生成树+并查集)
下一篇: sort的用法
OFShare
博客等级 码龄11年 8粉丝 140原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值