1141 PAT Ranking of Institutions (25 point(s))

Genesis物理引擎实战指南:轻量级确定性刚体仿真核心 刚体物理仿真作为机器人控制、嵌入式运动学验证和确定性游戏开发的基础技术,其核心在于数值稳定性、跨平台可复现性与约束求解精度。本文围绕线性互补问题(LCP)求解、半隐式欧拉积分和零依赖C++实现三大关键技术展开,解析如何在无GUI、低算力环境下构建可单步调试、帧级可控的确定性仿真系统。重点覆盖碰撞检测数学建模、关节局部坐标系绑定、质量-惯性张量一致性校验等工程落地关键点,适用于STM32、树莓派及教育实验场景。内容深度结合Genesis Physics Engine的源码实践,直击‘穿模’‘NaN’‘关节发软 阅读详情

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 ranklist.

Input Specification:

Each input file contains one test case. For each case, the first line gives a positive integer N (≤10​5​​), which is the number of testees. Then N lines follow, each gives the information of a testee in the following format:

ID Score School

where ID is a string of 6 characters with the first one representing the test level: B stands for the basic level, Athe advanced level and T the top level; Score is an integer in [0, 100]; and School is the institution code which is a string of no more than 6 English letters (case insensitive). Note: it is guaranteed that ID is unique for each testee.

Output Specification:

For each case, first print in a line the total number of institutions. Then output the ranklist of institutions in nondecreasing order of their ranks in the following format:

Rank School TWS Ns

where Rank is the rank (start from 1) of the institution; School is the institution code (all in lower case); ; TWS is the total weighted score which is defined to be the integer part of ScoreB/1.5 + ScoreA + ScoreT*1.5, where ScoreX is the total score of the testees belong to this institution on level X; and Ns is the total number of testees who belong to this institution.

The institutions are ranked according to their TWS. If there is a tie, the institutions are supposed to have the same rank, and they shall be printed in ascending order of Ns. If there is still a tie, they shall be printed in alphabetical order of their codes.

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
A72809 100 pku
A03274 45 hypu

Sample Output:

5
1 cmu 192 2
1 au 192 3
3 pku 100 1
4 hypu 81 2
4 lanx 81 2

中规中矩的模拟题。

考察点:重载运算符、STL的使用。

注意:

1. 将字符串变成小写:transform(s.begin(),s.end(),s.begin(),::tolower);

2. 名次赋值;

3. 迭代器的使用。

#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<ctype.h>
#include<map>
using namespace std;
struct InsRec{
	string ins;int ns;int tws;int rank;
	InsRec(string i,int n,int t):ins(i),ns(n),tws(t){}
	bool operator < (const InsRec &other) const{
		if(tws!=other.tws) return tws>other.tws;
		if(ns!=other.ns) return ns<other.ns;
		return ins<other.ins;
	}
};
map<string,vector<double> >mp;
vector<InsRec> v;
int main(void){
	int N;cin>>N;
	string id,ins;double grade;
	for(int i=0;i<N;i++){
		cin>>id>>grade>>ins;
		if(id[0]=='B') grade = grade/1.5;
		if(id[0]=='T') grade = grade*1.5;
		transform(ins.begin(),ins.end(),ins.begin(),::tolower);
		mp[ins].push_back(grade);
	}
	map<string,vector<double> >::iterator it;
	for(it = mp.begin();it!=mp.end();it++){
		double sumGrade=0.0;
		for(int i=0;i<(int)(it->second).size();i++){
			sumGrade+=(it->second)[i];
		}
		int cnt = (int)(it->second).size();
		v.push_back(InsRec((it->first),cnt,(int)sumGrade));
	}
	sort(v.begin(),v.end());
	for(int i=0;i<v.size();i++){
		if(i==0||(i>0&&v[i].tws!=v[i-1].tws)) v[i].rank=i+1;
		else v[i].rank = v[i-1].rank;
	}
	cout<<v.size()<<endl;
	for(int i=0;i<v.size();i++){
		cout<<v[i].rank<<" "<<v[i].ins<<" "<<v[i].tws<<" "<<v[i].ns<<endl;
	}
	return 0;
}

 

高通Camx功能feature分析之十:高通NCS服务之注册和启动 本文介绍了高通NCS(非相机传感器)服务的注册与启动流程。NCS通过QMI接口访问陀螺仪等传感器,为相机EIS/AEC等功能提供辅助数据。文章详细解析了服务注册时的QueryCapabilites能力查询、RegisterService注册流程,以及通过StartNCSService启动服务线程的过程。重点包括:1)AF/EIS等节点通过NCSService创建传感器对象;2)注册时需校验传感器类型和接口;3)首次注册成功后会启动NCS服务线程;4)采样率变化时需重新配置会话。通过线程池管理实现传感器数据的 阅读详情

相关推荐

从零搭建openEuler ARM64开发测试环境:手把手教你用libvirt+KVM配置虚拟机(含VNC远程安装)

本文详细介绍了如何在ARM64平台上从零搭建openEuler开发测试环境,涵盖libvirt和KVM配置虚拟机的完整流程,包括环境准备、存储配置、网络优化、XML配置详解以及VNC远程安装。特别针对华为欧拉(openEuler)系统进行了优化,帮助开发者快速构建高效的ARM架构虚拟化环境。

weixin_30545945的博客 587

1141 PAT Ranking of Institutions (25 point(s))

题解 unordered_map  #include&lt;iostream&gt; #include&lt;cstdio&gt; #include&lt;unordered_map&gt; #include&lt;algorithm&gt; #include&lt;vector&gt; using namespace std; struct node { string school; ...

徐伯莱 298

jmeter小白下载安装步骤

本文仅仅简单介绍了jmeter工具的下载安装,以及基础的操作步骤。

昔年@曦的博客 3497

PAT(A)1063 Set Similarity (25point(s))

Sample Input 3 3 99 87 101 4 87 101 5 87 7 99 101 18 5 135 18 99 2 1 2 1 3 Sample Output 50.0% 33.3% 思路: 判重,然后算重复率。 我本来想用map判重,最后一个点会超时,set在插入的时候就可以直接去重。 代码 #include <iostream> #include &lt...

Sqssq的博客 170

单细胞测序避坑指南:为什么你的免疫组库数据总出问题?5‘转录组7个关键细节

本文深度解析了5'端单细胞测序技术在免疫组库研究中的应用与常见问题。文章从5'端建库的分子机制入手,重点剖析了其在捕获TCR/BCR序列上的独特优势,并系统梳理了从样本处理、文库构建到数据质控全流程中7个最易出错的细节,为研究者提供了一份实用的避坑指南,旨在帮助提升免疫组库数据的质量和可靠性。

weixin_29208327的博客 482

储能系统架构和控制

探讨了储能系统中EMS(能源管理系统)、BMS(电池管理系统)和PCS(功率转换系统)之间的协同机制,以及组串式和集中式储能系统的技术架构、优势和局限性。EMS根据电价、电网需求和电池状态制定充放电策略,BMS提供电池数据,PCS执行充放电控制。组串式系统具有独立管理和灵活扩展的优势,但成本较高;集中式系统成本效益高,但存在环流和木桶效应问题。

蓝龙宝藏的博客 3969

1141 PAT Ranking of Institutions (25point(s)) - C语言 PAT 甲级

* 从题目上也可看出,又是一道排序题

有三只土豆 167

【VisionMaster】图像源模块之本地图像

图像采集之图像源

zhy29563 6961

【PAT】A1141 PAT Ranking of Institutions (25point(s))

文章目录A1141 PAT Ranking of Institutions (25point(s))Input Specification:Output Specification:Sample Input:Sample Output:CodeAnalysis Author: CHEN, Yue Organization: 浙江大学 Time Limit: 800 ms Memory Limit:...

Duke 380

详解如何用爬虫工具批量采集阿里巴巴批发网商品数据

本文主要介绍如何使用后羿采集器的智能模式,免费采集阿里巴巴批发网商品的批发价格、发货时间、是否代发等信息。 采集字段: 商品标题、商品链接、图片链接、标签1、标签2、标签3、价格、30天成交数、 评价、店铺 功能点目录: 如何对采集字段进行配置 如何采集列表+详情页类型网页 采集结果预览: 下面我们来详细介绍一下如何免费采集1688批发网的商品数据,我们以“羽绒服女”为例,具体步骤如下: 步骤一...

weixin_43777427的博客 1万+

《UDS协议从入门到精通》系列——图解0x14:清除诊断信息

图解0x14:清除诊断信息,简洁易懂,迅速上手!

车载系统攻城狮 4827

1141 PAT Ranking of Institutions (25 point(s))

思路: c++/STL,利用map保存输入,然后计算ScoreX,然后输出到vector,最后sort排序,输出排序结果。 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 th

专栏 148

GRCNN抓取网络学习3【自制Jacquard数据集模型调优】

请先完成,这样有利于下面操作的理解!然后第二步是,有了自己的数据集输入到GRCNN中是三种文件,那么可以GRCNN抓取网络学习2【自制Jacquard数据集训练】!既然学会训练,那么开展下一步计划模型调优。GRCNN源码:https://github.com/skumra/robotic-grasping。

vor234的博客 2502

PAT(A)1141 PAT Ranking of Institutions (25point(s))

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 A72809 100 pku A03274 45 hypu Sample Output 5 1 cmu 192 2 1 au 192 3 ...

Sqssq的博客 237

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

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

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

PAT(A) 1141 PAT Ranking of Institutions (25 point(s))

#include<bits/stdc++.h> using namespace std; struct node{ string sch; float tws = 0; int ns = 0; }; bool cmp(node a, node b){ if((int)a.tws != (int)b.tws) return a.tws > b.tws; if(a.ns != b.ns) return a.ns < b.ns; retu

Anpotan的博客 126

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

[PAT] C++ 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. Input Specification: Each input file c...

沧海漂游的博客 647

1141. PAT Ranking of Institutions (25)

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

zcc的博客 504

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. Input Specification: Each input file contai...

DayDream_x的博客 1149

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

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甲级A1141】 PAT Ranking of Institutions (25分)(c++)

1141 PAT Ranking of Institutions (25分) 作者:CHEN, Yue 单位:浙江大学 代码长度限制:16 KB 时间限制:400 ms 内存限制:64 MB 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. Inpu

小庄同学的博客 174

PAT 1141. PAT Ranking of Institutions (25) - 甲级

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.Input S...

柳婼 の blog 2804

PAT 1141 PAT Ranking of Institutions

总结:这道题目好久之前在乙级也写过了,需要注意的就是最后总成绩的计算是先将所有的浮点成绩算出来,然后通过 int 取整,可以先用map 的类型将浮点总成绩先存下来,然后逐一把每个学校的信息加进结构体中,最后进行排序。好好学习,天天向上!

weixin_50679551的博客 406

PAT A1141 PAT Ranking of Institutions

文章目录题目描述知识点实现码前思考代码实现码后反思 题目描述 1141 PAT Ranking of Institutions (25分) 知识点 PAT传统艺能——排序题 实现 码前思考 需要注意一些细节: 成绩是直接保留整数部分而不是四舍五入; 对于rank的输出的代码,PAT很多题都是这个套路,我记下来了,感觉很欣慰; 代码实现 //开两个unordered_map和一个结构体 #...

yc_cy1999的博客 245

1141 PAT Ranking of Institutions (25 分)

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

zhangshuosummer的博客 211
上一篇: 1140 Look-and-say Sequence (20 point(s))
下一篇: 1142 Maximal Clique (25 point(s))
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值