当前位置:网站首页>[NOIP2009 普及组] 分数线划定
[NOIP2009 普及组] 分数线划定
2022-07-06 04:42:00 【Recurss】
题目描述
世博会志愿者的选拔工作正在 A 市如火如荼的进行。为了选拔最合适的人才, A A A市对所有报名的选手进行了笔试,笔试分数达到面试分数线的选手方可进入面试。面试分数线根据计划录取人数的 150 % 150\% 150%划定,即如果计划录取 m m m名志愿者,则面试分数线为排名第 m × 150 % m \times 150\% m×150%(向下取整)名的选手的分数,而最终进入面试的选手为笔试成绩不低于面试分数线的所有选手。
现在就请你编写程序划定面试分数线,并输出所有进入面试的选手的报名号和笔试成绩。
输入格式
第一行,两个整数 n , m ( 5 ≤ n ≤ 5000 , 3 ≤ m ≤ n ) n,m(5 ≤ n ≤ 5000,3 ≤ m ≤ n) n,m(5≤n≤5000,3≤m≤n),中间用一个空格隔开,其中 n n n表示报名参加笔试的选手总数, m m m表示计划录取的志愿者人数。输入数据保证 m × 150 % m \times 150\% m×150%向下取整后小于等于 n n n。
第二行到第 n + 1 n+1 n+1 行,每行包括两个整数,中间用一个空格隔开,分别是选手的报名号 k ( 1000 ≤ k ≤ 9999 ) k(1000 ≤ k ≤ 9999) k(1000≤k≤9999)和该选手的笔试成绩$ s(1 ≤ s ≤ 100)$。数据保证选手的报名号各不相同。
输出格式
第一行,有 2 2 2个整数,用一个空格隔开,第一个整数表示面试分数线;第二个整数为进入面试的选手的实际人数。
从第二行开始,每行包含 2 2 2个整数,中间用一个空格隔开,分别表示进入面试的选手的报名号和笔试成绩,按照笔试成绩从高到低输出,如果成绩相同,则按报名号由小到大的顺序输出。
样例 #1
样例输入 #1
6 3
1000 90
3239 88
2390 95
7231 84
1005 95
1001 88
样例输出 #1
88 5
1005 95
2390 95
1000 90
1001 88
3239 88
提示
【样例说明】
m × 150 % = 3 × 150 % = 4.5 m \times 150\% = 3 \times150\% = 4.5 m×150%=3×150%=4.5,向下取整后为 4 4 4。保证 4 4 4个人进入面试的分数线为 88 88 88,但因为 88 88 88有重分,所以所有成绩大于等于 88 88 88 的选手都可以进入面试,故最终有 5 5 5个人进入面试。
NOIP 2009 普及组 第二题
/* * @Description: To iterate is human, to recurse divine. * @Autor: Recursion * @Date: 2022-07-04 18:46:06 * @LastEditTime: 2022-07-05 03:18:13 */
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn = 1e6 + 10;
const int mod = 1e9 + 7;
const int INF = 1e9 + 10;
const int N = 1e6;
int n;
double m;
int a[N];
struct node{
int k;
int s;
}t[N];
bool cmp(node x,node y){
if(x.s > y.s)
return true;
if(x.s == y.s){
if(x.k < y.k )
return true;
}
return false;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
int x;
x = m * 1.5;
for(int i = 1;i <= n;i ++){
cin >> t[i].k >> t[i].s;
}
sort(t + 1, t + 1 + n,cmp);
int num = x;
for(int i = x + 1;i <= n;i ++){
if(t[x].s == t[i].s)
num++;
}
cout << t[x].s << " " << num << endl;
for(int i = 1;i <= x;i ++){
cout << t[i].k <<" "<<t[i].s << endl;
}
for(int i = x + 1;i <= n;i ++){
if(t[x].s == t[i].s)
cout << t[i].k << " " << t[i].s << endl;
}
return 0;
}
边栏推荐
- Selection sort
- It is also a small summary in learning
- win10电脑系统里的视频不显示缩略图
- 程序员在互联网行业的地位 | 每日趣闻
- newton interpolation
- cdc 能全量拉去oracle 表嘛
- English Vocabulary - life scene memory method
- 比尔·盖茨晒18岁个人简历,48年前期望年薪1.2万美元
- The implementation of the maize negotiable digital warehouse receipt standard will speed up the asset digitization process of the industry
- Bill Gates posted his 18-year-old resume and expected an annual salary of $12000 48 years ago
猜你喜欢
Database - MySQL storage engine (deadlock)
满足多元需求:捷码打造3大一站式开发套餐,助力高效开发
Recommendation | recommendation of 9 psychotherapy books
Postman断言
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
Lombok principle and the pit of ⽤ @data and @builder at the same time
The most detailed and comprehensive update content and all functions of guitar pro 8.0
[FreeRTOS interrupt experiment]
Delete subsequence < daily question >
随机推荐
Bubble sort
Crawler notes: improve data collection efficiency! Use of proxy pool and thread pool
Certbot failed to update certificate solution
MPLS experiment
Postman断言
Embedded development program framework
JVM garbage collector concept
Quatre méthodes de redis pour dépanner les grandes clés sont nécessaires pour optimiser
Word cover underline
P2102 地砖铺设(dfs&贪心)
Guitar Pro 8.0最详细全面的更新内容及全部功能介绍
优秀PM必须经历这3层蜕变!
Use sentinel to interface locally
npm命令--安装依赖包--用法/详解
Easyrecovery reliable and toll free data recovery computer software
拉格朗日插值法
Meet diverse needs: jetmade creates three one-stop development packages to help efficient development
Recommendation | recommendation of 9 psychotherapy books
C. The Third Problem(找规律)
我想问一下 按照现在mysql-cdc的设计,全量阶段,如果某一个chunk的binlog回填阶段,