1062 Talent and Virtue (25 point(s))

[漏洞利用]利用五次Shift越权破解win7\win10开机密码 注:第一个学习和接触的Windows漏洞 文章目录本机实验环境前置知识漏洞原理漏洞介绍漏洞验证解决方法基本流程介绍详细步骤截图 本机实验环境 虚拟机:VMware Workstation 14 pro 操作系统:Windows10 前置知识 1、cmd工具路径 c:\windows\system32\cmd,按五次shift默认调用同目录下sethc文件,其路径为“c:\windows\system32\sethc.exe” 2、用户/账户密码存储位置 c:\windows\system32\config\ 阅读详情

1062 Talent and Virtue (25 point(s))

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virtue must be a "sage(圣人)"; being less excellent but with one's virtue outweighs talent can be called a "nobleman(君子)"; being good in neither is a "fool man(愚人)"; yet a fool man is better than a "small man(小人)" who prefers talent than virtue.

Now given the grades of talent and virtue of a group of people, you are supposed to rank them according to Sima Guang's theory.

Input Specification:

Each input file contains one test case. Each case first gives 3 positive integers in a line: N (≤10​5​​), the total number of people to be ranked; L (≥60), the lower bound of the qualified grades -- that is, only the ones whose grades of talent and virtue are both not below this line will be ranked; and H (<100), the higher line of qualification -- that is, those with both grades not below this line are considered as the "sages", and will be ranked in non-increasing order according to their total grades. Those with talent grades below H but virtue grades not are cosidered as the "noblemen", and are also ranked in non-increasing order according to their total grades, but they are listed after the "sages". Those with both grades below H, but with virtue not lower than talent are considered as the "fool men". They are ranked in the same way but after the "noblemen". The rest of people whose grades both pass the Lline are ranked after the "fool men".

Then N lines follow, each gives the information of a person in the format:

ID_Number Virtue_Grade Talent_Grade

where ID_Number is an 8-digit number, and both grades are integers in [0, 100]. All the numbers are separated by a space.

Output Specification:

The first line of output must give M (≤N), the total number of people that are actually ranked. Then M lines follow, each gives the information of a person in the same format as the input, according to the ranking rules. If there is a tie of the total grade, they must be ranked with respect to their virtue grades in non-increasing order. If there is still a tie, then output in increasing order of their ID's.

Sample Input:

14 60 80
10000001 64 90
10000002 90 60
10000011 85 80
10000003 85 80
10000004 80 85
10000005 82 77
10000006 83 76
10000007 90 78
10000008 75 79
10000009 59 90
10000010 88 45
10000012 80 100
10000013 90 99
10000014 66 60

Sample Output:

12
10000013 90 99
10000012 80 100
10000003 85 80
10000011 85 80
10000004 80 85
10000007 90 78
10000006 83 76
10000005 82 77
10000002 90 60
10000014 66 60
10000008 75 79
10000001 64 90

排序。注意优先级分为两个层次,组间(不同类型的人)、组内(同类型的人)的优先级。

#include<vector>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
struct record{
	int id;int T,V;//才、德 
	record(int i,int t,int v):id(i),T(t),V(v){}
	bool operator < (const record &other) const{
		if(T+V!=other.T+other.V) return T+V>other.T+other.V;
		if(V!=other.V) return V>other.V;
		return id<other.id;
	}
};
vector<record>sages,nobelman,foolman,smallman; 
void output(vector<record> &v){
	sort(v.begin(),v.end());
	for(int i=0;i<v.size();i++){
		printf("%08d %02d %02d\n",v[i].id,v[i].V,v[i].T);
	}
}
int main(void){
	int N,L,H;cin>>N>>L>>H;
	int id,T,V;
	for(int i=0;i<N;i++){
		cin>>id>>V>>T;
		if(T>=L&&V>=L){
			if(T>=H&&V>=H) sages.push_back(record(id,T,V));
			else if(T<H&&V>=H) nobelman.push_back(record(id,T,V));
			else if(T<H&&V<H&&V>=T) foolman.push_back(record(id,T,V));
			else smallman.push_back(record(id,T,V)); 
		}
	}
	cout<<sages.size()+nobelman.size()+foolman.size()+smallman.size()<<endl;
	output(sages);output(nobelman);output(foolman);output(smallman);
	return 0;
} 

 

数据分析案例-2024年裁员数据集可视化分析 本实验数据集来源于Kaggle,原始数据集为2020-2024年裁员数据,共有3577条,12个变量,该数据集提供了不同公司的裁员信息。它包括以下几栏:Company:裁员发生的公司名称。Location_HQ:公司总部位置。Industry:公司所属的行业或部门。Laid_Off_Count:公司解雇的员工数量。Percentage:公司员工被解雇的百分比。Date:裁员发生的日期。Source:信息来源网址。Funds_Raised:公司募集资金的信息。 阅读详情

相关推荐

CTP开发实战:如何高效处理预埋单与委托单的完整流程(附代码示例)

本文深入探讨了CTP开发中预埋单与委托单的完整处理流程,从订单生命周期理解、核心代码实现到异步事件处理与系统健壮性构建。通过详细的代码示例和状态机分析,为开发者提供了构建高可靠订单处理系统的实战指南,重点解决了状态同步、异常恢复等关键工程挑战。

weixin_29234239的博客 118

PAT 甲级 1062 Talent and Virtue 排序

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virt...

Yerkeys的博客 312

OsgEarth实战:飞机模型动态轨迹与雷达扫描效果实现详解

本文详细介绍了如何使用OsgEarth实现飞机模型动态轨迹与雷达扫描效果。通过实战案例,讲解了模型加载、路径规划、动态轨迹绘制、飞行姿态计算以及雷达扫描效果的实现方法,并提供了性能优化技巧,帮助开发者高效完成三维可视化项目开发。

weixin_29214199的博客 304

PAT-1062 Talent and Virtue

1062 Talent and Virtue(25 分) About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outst...

Eric的博客 273

傅里叶光学(1)

傅里叶光学,可以看作是通信理论中傅里叶变换等一系列数学思想以及系统理论与光学(主要是衍射光学)相结合的产物关于傅里叶光学的应用领域,本节介绍了成像,当然事实上不可能仅限于成像,经典的还如激光散斑的一些应用,干涉计量,还有傅里叶变换光谱学等等。最后总结一下,傅里叶光学我认为可以看做一个工具,对于任意的系统,它能给出一些数学思想与物理原理进行解释和分析,找出系统的扰动和响应的关系,或者说根据扰动和响应,来研究或者设计一个系统。

m0_53607446的博客 1685

高通camx架构学习(零)—— 深入理解Camera 硬件抽象层

从上面的定义可以看出,主要是通过hw_module_t 代表了模块,通过其open方法用来打开一个设备,而该设备是用hw_device_t来表示,其中除了用来关闭设备的close方法外,并无其它方法,由此可见谷歌定义的HAL接口,并不能满足绝大部分HAL模块的需要,所以谷歌想出了一个比较好的解决方式,那便是将这两个基本结构嵌入到更大的结构体内部,同时在更大的结构内部定义了各自模块特有的方法,用于实现模块的功能,这样,一来对上保持了HAL的统一规范,二来也扩展了模块的功能。

图像学习之旅 1670

pat(A) 1062. Talent and Virtue(结构体排序)

代码: #include #include #include #define N 100005 using namespace std; struct Node { int num; int v; int t; void Set(int x,int y,int z) { num=x; v=y; t=z;

24小时的程序员 704

从0到1:.NET 9 OpenAPI全攻略!Swagger vs Scalar UI谁更强?

OpenAPI:.NET 9的智能文档革命 本文深入解析.NET 9的OpenAPI支持,对比Swagger UI与Scalar UI的优劣,提供实战代码示例: 一键生成:AddOpenApi()+MapOpenApi()快速生成标准文档 UI工具对决: Swagger UI功能全面但复杂 Scalar UI简约现代,原生支持cURL/HTTPie 进阶技巧: XML注释增强文档可读性 自定义Transformer实现文档动态修改 🔥核心价值:.NET 9的OpenAPI方案显著降低API文档维护成本,开

java专栏 1428

PAT甲级1062 Talent and Virtue (25 分)

1062Talent and Virtue(25分) About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outs...

Dexter 250

会员管理小程序实战开发04-用户登录及注册

上一节我们介绍了用户信息数据源的创建及网格布局的使用,本节的话我们讲解用户的登录及注册功能任何开发。 在我们前述章节里介绍的,不论是管理员表还是用户表,都涉及到一个问题就是openid,那这个openid如何获取呢?如果我直接把代码贴给你,就缺失了一个思考的过程。既然这个是微信提出的概念,那么必然就会有官方文档作为对应。程序开发的基本功就是要会看官方文档,很多初学的开发同学可能会对官方文档颇有诟病,觉得不够基础。怎么说呢,当你进入到开发岗之后,自学能力是必要的,还是要试着可以看懂官方文档才好。 登录接口解读

低代码布道师的博客 1568

嵌入式工程师成长之路(0)----认识元件

在电子设计与维修中,认识元件是成功的关键!面对琳琅满目的电阻、电容、电感与二极管,样子形式千奇百怪,你是否也曾陷入困难? 本文基于行业权威分类标准,结合十年工程师实战经验,深度解析4大类、30+子类电子元件的核心特性、应用场景与避坑指南,助你从“小白”秒变“电子高手”!

云轩阁 11万+

UE4-Shader-Code

(1) Engine\Shaders\Private\ForwardLightingCommon.ush uint MortonCode( uint x ) { //x = (x ^ (x << 8)) & 0x00ff00ff; //x = (x ^ (x << 4)) & 0x0f0f0f0f; x = (x ^ (x << 2)) & 0x33333333; x = (x ^ (x << ...

kuangben2000的博客 377

最全教程cadence建立个人CIS数据库

此时如果你删除office365,再装Access数据库,可以安装上,然后你再装office365,系统又会把Access软件给你删除掉,因为冲突了。可以在自己的电脑上新建CIS库,主要包含下面几个内容:数据库文件,原理图封装,PCB封装,数据手册,另外建议做一个器件命名的说明。allegro在调用封装的时候,是看的.psm文件,而不是.dra文件,因此只要是c0402.psm,那么所有的内容都要保持一致。(1)文件夹不要有中文,不要有空格,否则无法识别,可以参考博主的方式,全部使用英文输入法下划线。

D_Katter的博客 254

1062 Talent and Virtue (25point(s))

1062 Talent and Virtue (25point(s)) About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being outstanding in both talent and virtue must be a “sage(圣

佳迪斯的博客 149

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

1062 Talent and Virtue (25 point(s))

1062.德才论

Bonstoppo 211

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

PAT甲级 1062 Talent and Virtue (25point(s))

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being outstanding in both talent and virt...

Seqlist_base的博客 297

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

1062 Talent and Virtue (25 point(s))

题解 STL应用与排序。 #include&lt;iostream&gt; #include&lt;vector&gt; #include&lt;cstdio&gt; #include&lt;algorithm&gt; using namespace std; struct node { int id, talent, virtue; bool operator &lt; (cons...

徐伯莱 251

1062 Talent and Virtue (25point(s)) - C语言 PAT 甲级

1. 在输入过程中将不录取数据丢弃,并返回录取人数 2. 利用 qsort 函数进行快速排序,防止超时

有三只土豆 2394

1062 Talent and Virtue (25分)

输入排序再输出的一个题。反正是读题要仔细,关键点是四类人的判定和最后输出的排序。output和input讲的输出格式和判定方法都和题干有点不一样。virtue和talent都高于H时为sage,virtue高于H,L<talent<H时为nobelman,剩下的virtue>talent为fool,其它的为smallman,两项有一项小于L的都不算进总数中。开四个vector分别...

ttu___的博客 192

PAT甲级A1062 Talent and Virtue (25 分)

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virt...

vir_lee的博客 294

PAT 甲级 1062 Talent and Virtue

1062 Talent and Virtue 题目大意:给出一组人数,按照要求分类再排序输出。圣人是virtue和talent都超过h的人,君子是virtue超过h并且talent位于[l,h)区间内的人,笨蛋是两个都位于[l,h)区间内并且virtue>=talent的人,剩下的达到最低标准l的都是小人。PS:python日常超时,C++这里完美AC class Person: def __init__(self,id,virtue,talent): self.id=id

zerohawk的博客 663

1062 Talent and Virtue(排序)

这类题目归结于常用技巧与算法,有很鲜明的套路,重在理解其规则,通常写起来不算太复杂。 题目描述: 题目大致意思: 输入N和最低下限和最高上限,接着输入N个人的编号,美德和天赋。如果美德和天赋都不低于最高上限则被称为圣人,把所有的圣人按照总分从高到低进行排列,如果总分相同,则按美德从高到底进行排序,如果美德值也相同,则按编号从小到大进行排序。 如果天赋值低于最高上限,但是美德值不低于最高上限,则被称为君子,把所有的君子按照总分从高到低进行排列,如果总分相同,则按美德从高到底进行排序,如果美德值也相同,则按

weixin_44046769的博客 264

「1062」Talent and Virtue

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being outstanding in both talent...

weixin_52435933的博客 237

【PAT甲级】1062 Talent and Virtue (25分)

解题过程的小记录,如有错误欢迎指出。 小导航~题目分析注意点我的解题过程思路bug代码dalao的代码借鉴点 题目分析 对一组人的德才分按照给定的规则进行排序 注意点 弄清楚一共分为四个组 运行超时的时候改一改输入输出,避免用cin cout 我的解题过程 思路 输入的时候就按照各自的德才分各自加入对应的数组,然后按照给定的排序规则给各组进行排序,因为各组的排序规则和输出规则是一样的所以可以写函数调用也来减少代码量。 bug 一开始在prit函数里采用cout的方法进行输出,有两个测试点运行超时,改成

SpicyChicken的自我修养 373

1062 Talent and Virtue (25 分)

#include<iostream> #include<string> #include<algorithm> using namespace std; struct people{ string name; int talent; int virtue; }; bool cmp1(people a,people b) { int totala=a.virtue+a.talent; int totalb=b.virtue+b.t

qq_43789349的博客 447

1062. Talent and Virtue (25)

1.主要涉及到一个根据规则排序的问题 2.分类规则 1)圣人,sages,virtue和talent都要>=high 2)君子,nobleman,virtue>=high,talent=low 3)愚人,fool man,low 4)愚人之后仍显示的,virtue>=low,talent>=low 3.跟结构体增加了一个level的变量,记录其所在的等级,排序比较函数如下: bool

Siukwan Program 334
上一篇: 1045 Favorite Color Stripe (30 point(s))
下一篇: 1089 Insert or Merge (25 point(s))
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值