"巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现) HDU 5702_solving order welcome to hdu to take part in the f-程序员宅基地

技术标签: HDU 水题  ACM算法  

Solving Order

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


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

Source
 

Recommend
liuyiding   |   We have carefully selected several similar problems for you:   5711  5710  5709  5708  5700 

水题,结构体排序


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
using namespace std;
//void printf(int begin,int end,int mid)
//{
//    int i;
//    if(begin>end)
//        return;
//    for(i=begin; i<=end; i++)
//        if(b[i]==a[mid])
//            break;
//    printf(begin,i-1,mid+1);  //中序,先左,后跟,再右。此时i为跟节点,左子树必定在begin到i-1里面。
//    printf(i+1,end,mid-begin+i+1);//中序,先左,后跟,再右。此时i为跟节点,右子树必定在i+1到end里面。
//    cout<<a[mid];
//    if(mid==1)
//        cout<<endl;
//    else
//        cout<<" ";
//}
struct node
{
   int id;
   char s[1000];
};
bool cmp(node a,node b)
{
    return a.id>b.id;
}
int main()
{
     int t;
     scanf("%d",&t);
     while(t--)
     {
         node f[1000];
         int n;
         cin>>n;
         int i;
         for(i=0;i<n;i++)
         cin>>f[i].s>>f[i].id;
         sort(f,f+n,cmp);
           for(i=0;i<n;i++)
              i==0?cout<<f[i].s:cout<<" "<<f[i].s;
              cout<<endl;
     }
}


 
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/sky_miange/article/details/51526924

智能推荐

java.lang.NoClassDefFoundError: Failed resolution of: Lcom-程序员宅基地

文章浏览阅读5.3k次。只有 ‘U’ 字有个大小写的区别,我本来以为不是这里的问题,但是死活都报错,然后我尝试重新命名了其中一个,正常了。建议大家在协同开发的时候,一定要注意文件命名,不要雷同!_java.lang.noclassdeffounderror: failed resolution of

电商客户价值细分 - RFM 模型(中)_rfm使用均值还是中位数判断价值-程序员宅基地

文章浏览阅读3.5k次,点赞5次,收藏19次。4.1 RFM 模型的概念RFM 模型是一个传统的数据分析模型,沿用至今约 60 年。1961 年,乔治·卡利南在顾客的资料库中指出,最近一次消费、消费频率、消费金额三项数据可以较为客观地描绘顾客的轮廓。企业针对近期有消费的“新客”、消费频率高的“常客”、消费金额高的“贵客”进行精准营销和广告投放,确实收到了意料之外的惊喜。因此,这三项数据成为了衡量客户价值和客户创利能力的重要工具和手段。也是 RFM 模型的三个重要指标:1)R(Recency):最近一次消费时间间隔_rfm使用均值还是中位数判断价值

java内存溢出问题排查_mfyvo-程序员宅基地

文章浏览阅读1.1k次。一、使用工具Eclipse Memory Analyzer tool, 简称MAT下载地址:http://www.eclipse.org/mat/downloads.php二、生成heap dump file (内存溢出时,自动生成)1、问题代码package com.mfy.vo;public class User { private int id = 111_mfyvo

Modbus-crc16校验原理和方法(含测试代码以及演算过程)_modbus crc-程序员宅基地

文章浏览阅读7.2k次,点赞18次,收藏59次。本文主要讲了modbuscrc16的计算方法和手算验证过程。以及一些modbus的基础知识_modbus crc

unity 物体沿某一坐标轴旋转_unity 绕一轴旋转-程序员宅基地

文章浏览阅读715次。obj.transform.Rotate(0, fRotateSpeed * Time.deltaTime, 0, Space.Self);_unity 绕一轴旋转

【测试】8bit和4bit量化对模型在MMLU数据集上准确率的影响_q4量化 mmlu-程序员宅基地

文章浏览阅读859次,点赞30次,收藏16次。下面是改变其中某个参数后在 MMLU 数据集上的准确率,可以看出即使是 4bit 对准确率影响都没有很大,首 Token 性能还可以接近原精度,还节省了大量的空间。ms,最后的测试结果还算比较接近官方的结果,以此作为 baseline 和量化后的模型权重对比推理下游任务准确率的损失情况。),4bit 量化包含两种 4bit 的数据类型 FP4 和 NF4,以及。Mistral-7B 是一个很强的 7B 开源模型,在 Mistral。)并直接在原精度(BF16)上进行推理,尝试复现出官方的准确率。_q4量化 mmlu

随便推点

短剧cps平台源码 抖音视频号快手短剧分销分佣推广短视频付费模式 自带短剧素材 亲测_短剧源码-程序员宅基地

文章浏览阅读1.4k次。其次,短剧CPS平台采用了短视频付费模式。付费模式的引入为短剧创作者提供了一种新的盈利途径,也为用户提供了更多多样化的内容选择。通过购买或获取源码,用户可以搭建自己的短剧CPS平台,实现短剧的创作、分销和推广。总之,短剧CPS平台源码是一种创新的服务模式,为短剧创作者、用户和平台运营者带来了诸多好处。未来,随着短视频行业的发展和用户需求的变化,短剧CPS平台将会继续创新和完善,为人们带来更加多样化和优质化的短剧体验。在这个背景下,短剧CPS平台应运而生,为用户提供了一种创作、分销、推广短剧的全新模式。_短剧源码

FDTD电磁波算法的一些问题_电磁波2dfdtd代码-程序员宅基地

文章浏览阅读3.3k次。/* FDTD-1D-2.2.c 1D FDTD simulation of a lossy dielectric medium *//* Simulation of a sinusoidal wave or a Gauss pulse transmiting in a lossy dielectric medium exsiting in free space */ /*8888888_电磁波2dfdtd代码

eclipse配置lombok以及使用_eclipse lombok enable-程序员宅基地

文章浏览阅读1.5k次。一、下载lombok.jar包,jar包下载路径:https://projectlombok.org/download二、将lombok.jar包复制到eclipse安装目录三、使用notepad++ 打开eclipse.ini,在最后添加以下代码并保存:-Xbootclasspath/a:lombok.jar-javaagent:lombok.jar 注意:-X..._eclipse lombok enable

西华计算机系研究生好不好,西华大学考研难吗?一般要什么水平才可以进入?...-程序员宅基地

文章浏览阅读1.8k次。首先,申明一点:考研本身就不是一件容易的事情,在考研的过程中,找准自己的定位、学会搜集资料、搜集信息并且辅之于踏实的备考、准确的方法是至关重要的。同时,要学会坚持,不忘初心,很多同学在开始备考时,斗志昂扬,但是在进度接近尾声时,自己的志气也接近了尾声,这是万万不行的。有句话说的好:“骆驼走得慢,但终能到达终点”。我们也是,过程中,要循序渐进的进步,一步一步的坚持备考,终能到达彼岸。接下来,给大家一..._西华大学计算机考研好考吗

搭建Windows Server 2008故障转移群集-程序员宅基地

文章浏览阅读255次。本文章将详细讲述基于Windows Server 2008 R2的故障转移群集的实现,包括基本知识介绍,故障转移群集环境准备,实施过程,群集的维护等。故障转移群集可以配置使用多种不同的配置。组成群集的服务器可以是活跃状态或不活跃状态,而不同服务器可以被配置为在活跃服务器故障后立刻接管相应的资源。一般故障转移的过程只需要几分钟的时间,至于时间的长短主要取..._安装故障转移群集中的验证配置步骤,测试工作包括

【深大C语言OJ】对齐输出(格式化输出)_深大oj-程序员宅基地

文章浏览阅读748次,点赞19次,收藏9次。因为是输出部分的变化,所以我们需要调整printf函数中的内容,因为默认就是右对齐输出,所以这个可以不用管;至于占8个字符输出,将%d改为%8d即可。此题在输出整数的基础上多了两个要求,一个是每个整数占8个字符的宽度输出,一个是右对齐输出。另外还需要注意三个整数之间要用空格分开。只有一行,按照格式要求依次输出三个整数,之间以一个空格分开。读入三个整数,按每个整数占8个字符的宽度,右对齐输出它们。只有一行,包含三个整数,整数之间以一个空格分开。_深大oj

推荐文章

热门文章

相关标签