当前位置:网站首页>1004 成绩排名 (20 分)
1004 成绩排名 (20 分)
2022-08-05 05:16:00 【呆比特】
1004 成绩排名 (20 分)
题目要求:
代码:
import java.util.Scanner;
import java.util.TreeMap;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
//輸入
int n = scan.nextInt();
scan.nextLine();
/* * 因为题目保证每个学生成绩不相同,且需要排序 * 因此选择使用TreeMap,key保存成绩,value保存要输出的信息,TreeMap默认升序 * */
TreeMap<Integer, String> map = new TreeMap<>();
for (int i = 0; i < n; i++) {
String str = scan.nextLine();
String[] s = str.split(" ");
map.put(Integer.valueOf(s[2]),s[0] + " " + s[1]);
}
//直接输出
System.out.println(map.get(map.lastKey()));
System.out.println(map.get(map.firstKey()));
}
}
结果:
边栏推荐
- 用GAN的方法来进行图片匹配!休斯顿大学提出用于文本图像匹配的对抗表示学习,消除模态差异!
- CVPR最佳论文得主清华黄高团队提出首篇动态网络综述
- 大型Web网站高并发架构方案
- 如何跟踪网络路由链路&检测网络健康状况
- 十一、拦截器运行原理
- MSRA proposes extreme masking model ExtreMA for learning instances and distributed visual representations
- CH32V307 LwIP移植使用
- CVPR 2022 |节省70%的显存,训练速度提高2倍
- dataframe 常用操作
- A deep learning code base for Xiaobai, one line of code implements 30+ attention mechanisms.
猜你喜欢

CVPR最佳论文得主清华黄高团队提出首篇动态网络综述

CVPR best paper winner Huang Gao's team from Tsinghua University presented the first dynamic network review

OSPF故障排除办法

【数据库和SQL学习笔记】5.SELECT查询3:多表查询、连接查询

ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!

【数据库和SQL学习笔记】4.SELECT查询2:排序(ORDER BY)、聚合函数、分组查询(GROUP BY)

BFC详解(Block Formmating Context)

【数据库和SQL学习笔记】8.SQL中的视图(view)

【论文精读】Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation(R-CNN)

Redis集群(docker版)——从原理到实战超详细
随机推荐
AIDL详解
关于存储IOPS你必须了解的概念
Comparison and summary of Tensorflow2 and Pytorch in terms of basic operations of tensor Tensor
关于使用QML的MediaPlayer实现视频和音频的播放时遇到的一些坑
C语言联合体union占用空间大小问题
SQL (2) - join window function view
Thread handler handle IntentServvice handlerThread
基于STM32F407的WIFI通信(使用的是ESP8266模块)
神经网络也能像人类利用外围视觉一样观察图像
ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!
轻松接入Azure AD+Oauth2 实现 SSO
如何编写一个优雅的Shell脚本(三)
八、响应处理——ReturnValueHandler匹配返回值处理器并处理返回值原理解析
WCH系列芯片CoreMark跑分
[Database and SQL study notes] 9. (T-SQL language) Define variables, advanced queries, process control (conditions, loops, etc.)
SSL 证书签发详细攻略
Oracle压缩表修改字段的处理方法
CVPR2021 - Inception Convolution with Efficient Dilation Search
tensorflow的session和内存溢出
CVPR最佳论文得主清华黄高团队提出首篇动态网络综述