当前位置:网站首页>[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;
}
边栏推荐
- Platformio create libopencm3 + FreeRTOS project
- VPP performance test
- Dry goods collection | Vulkan game engine video tutorial
- It is also a small summary in learning
- Bubble sort
- Ue5 small knowledge points to enable the setting of lumen
- Uva1592 Database
- ISP学习(2)
- 内核判断i2c地址上是否挂载外设
- RTP gb28181 document testing tool
猜你喜欢
Basic explanation of turtle module - draw curve
比尔·盖茨晒18岁个人简历,48年前期望年薪1.2万美元
CADD course learning (8) -- virtual screening of Compound Library
Solve the compilation problem of "c2001: line breaks in constants"
CADD课程学习(8)-- 化合物库虚拟筛选(Virtual Screening)
Jd.com 2: how to prevent oversold in the deduction process of commodity inventory?
Vulnerability discovery - vulnerability probe type utilization and repair of web applications
CertBot 更新证书失败解决
IPv6 comprehensive experiment
Case of Jiecode empowerment: professional training, technical support, and multiple measures to promote graduates to build smart campus completion system
随机推荐
Flink kakfa data read and write to Hudi
MPLS experiment
Lombok principle and the pit of ⽤ @data and @builder at the same time
1008 circular right shift of array elements (20 points)
SharedPreferences 源码分析
[FreeRTOS interrupt experiment]
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
JVM garbage collector concept
The implementation of the maize negotiable digital warehouse receipt standard will speed up the asset digitization process of the industry
Sqlserver query results are not displayed in tabular form. How to modify them
8. Static file
SharedPreferences source code analysis
【HBZ分享】ArrayList的增删慢查询快的原因
RTP gb28181 document testing tool
Implementation of knowledge consolidation source code 1: epoll implementation of TCP server
Quatre méthodes de redis pour dépanner les grandes clés sont nécessaires pour optimiser
How does vs change the project type?
[数学建模] 微分方程--捕鱼业的持续发展
Fedora/REHL 安装 semanage
After learning classes and objects, I wrote a date class