sort(HDU-3293)

为什么你的SiC MOSFET仿真不准?可能是离子注入的‘沟道效应’在捣鬼(Silvaco BCA模块详解) 本文深入分析了SiC MOSFET仿真中离子注入沟道效应的关键影响,揭示了Silvaco BCA模块在模拟SiC晶向和角度参数时的核心设置要点。通过详细解析晶圆偏切与注入角度的等效关系,提供优化MOSFET沟道区注入仿真的五步实战方法,帮助工程师将阈值电压仿真误差从26%降低到5%以内。 阅读详情
Problem Description
As is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of girls. Owe to some unknown reasons, girls are necessary to fight for peace.
Their boss, lcy, wants to strengthen their ability, so he give them his precious collections---weapons for many years. Because these collections are really age-old, it is hard to recognize from one to another. So girls intend to sort them before they use. Each weapon has its name, origin and level of harmfulness ( level contains three ranks: wonderful, good, so-so).
In order to make it clear, girls want to sort like this:
firstly,sort according to the origin (sort by lexicographic order), if two or more have the same origin, they will be sorted together;
secondly, sort according ranks, wonderful is the best, good is next, the third is so-so;
thirdly, if two or more have same origin and rank, sort them according to the lexicographic order.


 

Input
Input contains multiply cases. Each case contains several lines. First line is an integer N(0<N<=500), representing the number of weapons. Then N lines follows. Each line represent a kind of weapon, and contains a set of strings representing name, origin and level of harmfulness. 
Each string will not exceed 20 characters.
Sure that same origin will not exist the same weapon.
 

Output
Please output your list after sorting (format according to sample, pay attention to the spaces,ten spaces need ^ ^).
 

Sample Input
5 knife qizhou so-so gun qizhou wonderful knife zhengzhou good stick zhengzhou good rope shengzhou so-so
 

Sample Output
Case 1 qizhou: gun wonderful knife so-so shengzhou: rope so-so zhengzhou: knife good stick good
 
代码如下:
#include<bits/stdc++.h>
using namespace std;
struct pp
{
    string ori,na,le;
    int l;
};
pp p[510];
bool cmp(const pp&a,const pp&b)
{
    if(a.ori!=b.ori)
        return a.ori<b.ori;
    else if(a.l!=b.l)
        return a.l<b.l;
    else
        return a.na<b.na;
}
set<string>origin;
int main()
{
    int n,t=1;
    while(cin>>n)
    {
        string a,b,c;
        for(int i=0;i<n;i++)
        {
            cin>>p[i].na>>p[i].ori>>p[i].le;
            origin.insert(p[i].ori);
            if(p[i].le[0]=='w')
                p[i].l=1;
            else if(p[i].le[0]=='g')
                p[i].l=2;
            else
                p[i].l=3;
        }
        int l=0;
        sort(p,p+n,cmp);
        cout<<"Case "<<t<<endl;
        for(set<string>::iterator it=origin.begin();it!=origin.end();it++)
        {
            cout<<*it<<":\n";
            for(;l<n&&*it==p[l].ori;l++)
                cout<<"          "<<p[l].na<<" "<<p[l].le<<endl;
        }
        t++;
        origin.clear();
    }
    return 0;
}


RAG面试内容整理-8. 文档分块策略(滑动窗口、语义切分) RAG系统通常面对长文档或整篇知识库资料的检索需求,但大模型一次处理的文本长度有限,向量索引也需固定大小的文本片段。因此,将长文档拆分成合适片段是必不可少的步骤,被称为文档分块(chunking)策略。 阅读详情

相关推荐

基于Meteoinfo与TrajStat的后向轨迹聚类分析实战:从数据准备到可视化制图

本文详细介绍了基于Meteoinfo与TrajStat进行后向轨迹聚类分析的完整实战流程。从Java环境配置、Meteoinfo软件与TrajStat插件安装,到精准获取NOAA气象数据、设置参数进行批量轨迹计算,再到利用聚类分析提炼主要气流路径,并最终完成专业地图可视化与制图。文章旨在帮助环境与气象研究者快速掌握从数据准备到成果输出的全链路操作。

p4q5r6s7t的博客 805

HDU3293:sort

Problem Description As is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of girls. Owe to some unknown reasons, girls are nece

ACM!荣耀之路! 1977

一文说清STM32CubeMX中文汉化全流程(图解说明)

详细讲解STM32CubeMX中文汉化的完整流程,通过图文并茂的方式手把手教学,解决界面英文带来的使用障碍,让开发更高效。掌握stm32cubemx中文汉化技巧,提升嵌入式开发体验。

weixin_42499004的博客 6289

HDU 3293 由简单排序引发出的一点思考

C - sort Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description As is known to all, long long ago sailormoon once was an association of

DT2131 512

用简单仿真链路产生 WiFi CSI(不依赖专用工具箱,matlab实现)

这篇文章详细介绍了使用MATLAB仿真生成WiFi信道状态信息(CSI)的过程。内容包括:准备工作(定义OFDM和MIMO参数)、基本参数设置(天线数、FFT点数等)、构造训练OFDM符号、多径瑞利信道建模、逐天线时分发射接收处理、CSI信道估计方法,以及幅值和相位的可视化。通过BPSK调制和瑞利衰落信道仿真,实现了简单的CSI生成流程,为初学者理解CSI产生机理提供了直观指导。文章强调这仅是基础仿真,更深入的研究需要实际数据采集。文末还提供了WiFi指纹定位的相关参考资料。

静水流深,沧笙踏歌 1205

Scrum中敏捷项目经理(Scrum Master)扮演什么角色?

Scrum Master是Scrum团队中的“服务员”,负责确保所有人都能理解Scrum的理论、实践和规则,以及帮助团队最大化Scrum的利益。Scrum Master服务于Product Owner,帮助Product Owner理解如何使团队的工作最有效地满足产品目标。Scrum Master服务于Development Team,移除开发团队工作上的障碍,保证团队按照Scrum的方式运作。Scrum Master不是团队领导。Scrum团队是自组织的,意味着团队具有做出决策的能力。

huaqianzkh的专栏 2518

hdu 3293

这一题死的很悲剧,就n值问题,起初我还一直以为是排序的cmp出问题了,检查它,却忽略了后面的检查……呜呜~~~~(&gt;_&lt;)~~~~ 竟然wa了那么多次,而且用了那么长时间,如此基础的题目,看来我检查错误的能力还有待改善啊~~~ View Code #include &lt;cstdio&gt;#include &lt;cstdlib&gt;#include &lt;...

aoyuan4706的博客 162

ESP32锂电池电量检测实战:从引脚选择到低功耗优化(附完整电路图)

本文详细介绍了ESP32锂电池电量检测的实战方案,从ADC引脚选择到低功耗优化,提供完整的电路图和代码实现。通过MOS管智能开关和深度睡眠技术,显著降低静态功耗至0.5μA,提升设备续航能力。适合物联网开发者解决电量检测中的常见问题。

weixin_28731223的博客 463

HDU 3293

字符串的排序模拟: 以后最好都用 qsort。这里用sort排序出来的结果不对。sort 是用大于小于号来返回bool值进行排序。qsort 则返回int类型,从而进行排序 PS:升序用后一个减去前一个 #include #include #include #include using namespace std; struct Weapon { char name[21]

For free 520

CodeQL查询时遇到报错:A fatal error occurred: Could not process query metadata for...如何解决?

🏆本文收录于 《全栈Bug调优(实战版)》 专栏,该专栏专注于分享我在真实项目开发中遇到的各类疑难Bug及其深层成因,并系统提供高效、可复现的解决思路和实操方案。无论你是刚入行的新手开发者,还是拥有多年项目经验的资深工程师,本专栏都将为你提供一条系统化、高质量的问题排查与优化路径,助力你加速成长,攻克技术壁垒,迈向技术价值最大化与职业发展的更高峰🚀!

**My Coding Family** 1086

Unity GameObject 核心机制深度解析:从底层结构到工程实践

从底层机制讲透 Unity GameObject:托管壳加原生芯的双层对象模型如何制造假 null 陷阱、Transform 层级与组件通信的原理、生命周期回调的确切顺序。文章同时给出 Instantiate 成本分析与对象池等高频场景的工程实践。

游戏人生 40

hdu 3293 sort

hdu 3293 sort 题目: sort Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 752    Accepted Submission(s): 355 Problem Descriptio

问鼎63的博客 566

MyBatis-Plus 实战:敏感字段自动加解密支持模糊查询

本文基于MyBatis-Plus框架提出了一种全链路敏感字段加密方案。通过自定义TypeHandler实现数据入库自动加密和查询自动解密,结合重写LambdaQueryWrapper处理查询条件加密,并适配多种查询方式。方案核心包括:1)AESUtil工具类提供加解密基础能力;2)EncryptTypeHandler实现字段类型转换;3)实体类通过注解配置加密字段。该方案在保证数据安全的同时,对业务代码侵入性小,支持姓名、手机号等敏感信息的全流程加密处理,满足系统开发的安全需求。

蔡定努 596

Hdu 3293 - sort

排序题    字典序     题目的大致意思是: 每一种武器都有它们的名字,产地,和伤害等级。 在排序时,先排产地。按字典序从a ~ z 排序,如果一个产地里有多种武器,那也把武器排列在一起;然后,在每一个产地里,再根据它们的伤害等级排列,从高级到低级分别是 wonderful  ~  good  ~  so-so  ;最后如果两个或者两个以上的武器有相同的产地和伤害等级,那就根据名字的

Chuck的博客 526

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

HDU3293 sort 【排序】

sort Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 694    Accepted Submission(s): 324 Problem Description As is known to all, long long

星尘 437

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

HDU 3293 sort

sort Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 591    Accepted Submission(s): 271 Problem Description As is known to all, long

忆梦 926

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

HDU 3293 sort [Ad Hoc]

Description三个关键字 都是字符串,排序Algorithm用C++ 的 sort函数 和 字符串类Code#include <cstdio> #include <iostream> #include <algorithm> using namespace std; const int maxn = 500 + 9; int t = 0; int n; struct V { string

more time 394

HDU 3293:sort

Problem Description As is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of girls. Owe to some unknown reasons, girls are nece

Valieli的博客 503

HDU 3293 sort

这里最好用qsort排序,而在写cmp函数时要注意,对rank进行排序是从大到小,所以那里不要写反了,还有排序优先级是origin,,rank,字典序,这里别弄错了,我悲剧额,对rank排序一直是错的,最后听小白一说才恍然大悟,在此鸣谢小白,直接上代码 #include&lt;stdio.h&gt; #include&lt;stdlib.h&gt; #include&lt;string....

weixin_30823833的博客 87

HDU-3293-sort

sort Time Limit : 3000/1000ms (Java/Other)Memory Limit : 65535/32768K (Java/Other) Total Submission(s) : 8Accepted Submission(s) : 3 Font:Times New Roman|Verdana|Georgia Font Size:←...

weixin_33938733的博客 75

HDU 3293 sort(结构体排序)

Problem Description As is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of girls. Owe to some unknown reasons, girls a...

weixin_30535565的博客 151

武器排序HDU3293:sort

首先声明,我是一个菜鸟。一下文章中出现技术误导情况盖不负责 Problem Description As is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of g...

weixin_30621919的博客 101

HDU - 3293B - sort与HDU - 1263 水果 pair的使用

s is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of girls. Owe to some unknown reasons, girls are necessary to fight for pea

深海沧澜的博客 526

HDU--杭电--3293--sort--结构体排序

sort Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 596    Accepted Submission(s): 274 Problem Description As is known to all, long

浩爷地带,你的地盘听我的.... 842

HDOJ1872(稳定排序)

稳定排序 Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1066Accepted Submission(s): 408 Problem Description 大家都知道,快速排序是不稳定的排序方法。 如果对于...

weixin_30402085的博客 491
上一篇: Bombing(HDU-4022)
下一篇: Intelligent IME(HDU-4287)
绿蚁.r
博客等级 码龄10年 4粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值