PAT甲级1141

中兴SDH设备开局及业务配置 中兴SDH设备开局及业务配置 1.设备开局(S200-----S325) A.开电之后,按住截铃(bell off)开关,直至NCP告警灯变成橙色; B.此时,设备进入Download状态,设备IP为:192.192.192.11/24; 2.用交叉线(568A)将设备的QX口连接至电脑,电脑配置和设备相同网段的IP信息; 3.在电脑上测试连通性:pin... 阅读详情

PAT甲级1141

题目大意:给出各个考生PAT的成绩,甲级1,顶级1.5,乙级/1.5,统计每个学校总共拿了多少分以及一共有多少成员参加。先输出学校总数,然后按照总分从高到低排列,总分相同按照参赛人数从小到大排列,若参赛人数也一样则按照学校字母序排列。
map保存每个学校总分以及成员,遍历统计即可。注意这里统计分数要用double型,不然会损失精度测试点5不通过。

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

struct School{
	string name;
	int score,member,rank;
};
bool cmp(School a,School b){
	if(a.score!=b.score) return a.score>b.score;
	else if(a.member!=b.member) return a.member<b.member;
	else return a.name<b.name;
}
map <string,int> member;
map<string,double> school;
string toLower(string a){
	for(int i=0;i<a.length();i++){
		a[i]=tolower(a[i]);
	}
	return a;
}
int main(){
	int n,tmpscore,cnt=1,same=1;
	string tmpid,tmpschool;
	scanf("%d",&n);
	vector<School> v;
	set<string> sc;
	for(int i=0;i<n;i++){
		cin>>tmpid>>tmpscore>>tmpschool;
		tmpschool=toLower(tmpschool);
		sc.insert(tmpschool);
		if(tmpid[0]=='T')
			school[tmpschool]+=(tmpscore*1.5);
		else if(tmpid[0]=='A')
			school[tmpschool]+=tmpscore;
		else school[tmpschool]+=(tmpscore/1.5);
		member[tmpschool]++;
	}
	for(auto it:sc){
		School tmp;
		tmp.name=it;
		tmp.score=(int)school[it];
		tmp.member=member[it];
		v.push_back(tmp);
	}
	sort(v.begin(),v.end(),cmp);
	printf("%d\n",v.size());
	for(int i=0;i<v.size();i++){
		if(i==0) cout<<cnt<<" "<<v[i].name<<" "<<v[i].score<<" "<<v[i].member<<endl;
		else{
			if(v[i].score!=v[i-1].score){
				cnt+=same;
				same=1;
			}else same++;
			cout<<cnt<<" "<<v[i].name<<" "<<v[i].score<<" "<<v[i].member<<endl;
		}
	}
	system("pause");
	return 0;
}

告警不是闹钟:AI 如何把告警过滤成真正的“求救信号”? 阅读详情

相关推荐

OrthoFinder功能、流程和文件注释

OrthoFinder 的标准输出包括:直系同源组,直系同源基因,有根基因树,解析基因树,无根物种树、有根物种树,基因重复事件以及相关的统计数据。

hs6605015的博客 3046

PAT 甲级 1141 PAT Ranking 个人错误总结

这个题目的最后一个point挺有趣的,如果用int进行输出就过不了,但是如果用double也过不了,在排序和排rank的时候必须用int型排序或者是floor函数处理,所以我干脆就新建一个sum变量作为最后的输出了。。。 #include<bits/stdc++.h> using namespace std; struct school{ string name; double tws=0; int sum; int ns=0; int rank; }temp; bool cmp(s

☁的博客 180

ADRV9026初始化避坑指南:手把手调试PostMcsInit常见故障

本文详细解析了ADRV9026多片同步初始化过程中的PostMcsInit常见故障,包括时钟校准失败、JESD链路建立问题和ARM核通信异常等。通过实际项目经验,提供了硬件检查清单、软件配置要点和分层诊断方法,帮助工程师快速定位和解决问题,提升系统稳定性。

hadoop5ranger的博客 620

【PAT1141】PAT Ranking of Institutions

1.题目 2.代码 #include <iostream> #include <vector> #include <algorithm> #include <cstring> #include <unordered_map> using namespace std; const int N = 100010; struct School{ string name; double score; int count;

zjutkarma的博客 204

pgsql行列转换

‌是PostgreSQL中的一个函数,用于将一个字符串根据正则表达式进行分割,并将结果返回为一个表格,每个分割后的部分作为一行‌‌。string_agg() 函数是 PostgreSQL 中的一个聚合函数,用于将一个列中的值连接成一个字符串。

chimchim66的博客 3502

解放双手:用KUKA示教器白键一键触发复杂工艺,自定义你的快捷指令

本文详细介绍了如何利用KUKA示教器的工艺白键功能,通过自定义快捷指令一键触发复杂工艺,显著提升自动化产线效率。文章涵盖UserTech技术栈解析、KRL脚本封装、人机交互视觉工程及工业实战策略,帮助工程师实现机械臂操作的高阶优化。

weixin_30379531的博客 432

1141. PAT Ranking of Institutions (25)

PAT Ranking of Institutions (25) 时间限制 500 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue After each PAT, the PAT Center will announce the ranking of institutions based on thei...

jackiewoo_的博客 313

ROS & ROS2 机器人深度相机激光雷达多传感器标定工具箱入门教程(一)

multisensor_calibration 是一个积极维护的通用标定工具箱,用于辅助基于目标的多传感器标定,支持 ROS 1 和 ROS 2。它提供了多种方法和应用来标定复杂的多传感器系统,例如。

2506_90492529的博客 3261

PAT【甲级】1141

题目链接:PAT【甲级】1141 题目简述:有点和1012这个题目相似,就是给定考生的id、分数、所属机构,让我们去求解一个排名表。这个排名表每项是由rank、机构名称、总分、人数构成,排序时需按照一定的优先级进行排列。 #include<bits/stdc++.h> using namespace std; struct node{ string institution; int score; int total; bool operator < (co

qq_41375322的博客 194

如何在非序列模式下使用类似图像模功能

如何在非序列模式下使用类似图像模功能

weixin_72050316的博客 552

MIKE水动力笔记1_岸线及水深数据之依靠全球数据库资源提取的方法

通过各种数据库资源来获取全球岸线及水深数据,这种方法获取的岸线及水深数据精度偏低,比较适合大尺度范围的水动力研究。

晏长街的博客 1万+

1141 PAT Ranking of Institutions(25 分)

按照题意写完提交最后一个测试点过不去 Score = ScoreB/1.5 + ScoreA + ScoreT*1.5 因为score是整型而1.5是小数,乘除的过程中会出现精度的问题 所以我的解决方案是先将B,A,T三个级别的分数分开存放,输入数据处理好后再按照系数算出score的值 代码如下   #include&lt;stdio.h&gt; #include&lt;string...

qq_36513490的博客 790

基于simulink的AI融合与深度学习控制的场景实例:基于强化学习的电动汽车能量管理策略优化仿真

本文介绍了基于强化学习的电动汽车能量管理策略优化仿真方法。通过Simulink构建包含驾驶循环输入、电池子系统、电机驱动系统和强化学习控制器的仿真模型,采用DQN等算法训练智能代理,设计奖励函数优化能量分配。详细说明了建模步骤和参数设置,包括环境定义、代理训练和性能评估指标。该方法能有效提升电动汽车的续航里程、电池寿命和能源利用效率,为智能能量管理系统设计提供参考。

xiaoheshang_123的博客 154

pat甲级 1141 PAT Ranking of Institutions (25分)

文章目录1.错误代码1.1测试结果 pat甲级 1141 PAT Ranking of Institutions (25分) 1.错误代码 #include <iostream> #include <cctype> #include <unordered_map> #include <vector> #include <algorithm> using namespace std; struct node {int score,ns;}; un

qq_44992782的博客 285

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

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

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

【PAT甲级 - C++题解】1141 PAT Ranking of Institutions

📣专栏定位:为想考甲级PAT的小伙伴整理常考算法题解,祝大家都能取得满分!

Newin2020的博客 411

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

PAT甲级 1141

1141 PAT Ranking of Institutions (25 分) After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist. In...

YOUN尔 458

PAT_甲级_1141 PAT Ranking of Institutions (25point(s)) (C++)【模拟/结构体排序】

目录 1,题目描述 题目大意 2,思路 数据结构 算法 3,AC代码 4,解题过程 第一搏 第二搏 1,题目描述 Sample Input: 10 A57908 85 Au B57908 54 LanX A37487 60 au T28374 67 CMU T32486 24 hypu A66734 92 cmu B76378 71 AU A47780 45 lanx...

&再见萤火虫&的博客 495

PAT甲级1141~1145|C++实现

PAT甲级1141 PAT Ranking of Institutions (25分)|C++实现 PAT甲级1142 Maximal Clique (25分)|C++实现 PAT甲级1143 Lowest Common Ancestor (30分)|C++实现 PAT甲级1144 The Missing Number (20分)|C++实现 PAT甲级1145 Hashing - Average Search Time (25分)|C++实现 ...

weixin_42393947的博客 156

PAT 甲级 1141  PAT Ranking of Institutions

1141PAT Ranking of Institutions(25 point(s)) After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the rankli...

漫浸天空的雨色的备忘录~ 743

PAT甲级真题1141 PAT单位排行

每次 PAT 考试结束后,考试中心都会发布一个考生单位排行榜。 本题就请你实现这个功能。 输入格式 输入第一行给出一个正整数 NN,即考生人数。 随后 NN 行,每行按下列格式给出一个考生的信息: 准考证号 得分 学校 其中 准考证号 是由 66 个字符组成的字符串,其首字母表示考试的级别:B 代表乙级,A 代表甲级,T 代表顶级;得分 是 [0,100][0,100] 区间内的整数;学校是由不超过 66 个英文字母组成的单位码(大小写无关)。 注意:题目保证每个考生的准考证号是不同的。 输出格式 首先在一

qq_43738331的博客 239

PAT甲级真题1141: PAT单位排行

PAT甲级真题1141: PAT单位排行

进一步有一步的欢喜 289

17冬第二题 PAT甲级 1141 Ranking of Institutions (25分) 有点鸡贼

题目 After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist. Input Specification: Each input file c...

qiiingc的解题记录 794

PAT 甲级 1141 PAT Ranking of Institutions

https://pintia.cn/problem-sets/994805342720868352/problems/994805344222429184 After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now yo...

weixin_30528371的博客 101

PAT——1141 PAT Ranking of Institutions 甲级

1141 PAT Ranking of Institutions题目题意题目解析注意AC代码参考 题目 https://pintia.cn/problem-sets/994805342720868352/problems/994805344222429184 题意 题目会给出N个学生的ID、分数、学校,要求在统计每个学校的总人数和总分数后,按要求输出 题目解析 通过map存储每一个学校的相关信息,之后遍历map将元素存入ans的vector向量中,再按照题目要求对ans排序,最后按照排名输出即可 注意 成员

ljhsq的博客 156

PAT 甲级1141 PAT Ranking of Institutions

1141 PAT Ranking of Institutions After each PAT, the PAT Center will announce the ranking of institutions based on their students’ performances. Now you are asked to generate the ranklist. Input Specification: Each input file contains one test case. For ea

cyberickk blog 204

PAT甲级A1141 PAT Ranking of Institutions (25 分)

After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist. Input Specification: Each input file conta...

vir_lee的博客 350

PAT甲级1141解题报告

  1141 PAT Ranking of Institutions (25 point(s)) After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ran...

TateBrwonJava的博客 377
上一篇: PAT甲级1134
下一篇: PAT甲级1142
zerohawk
博客等级 码龄8年 3粉丝 78原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值