当前位置:网站首页>[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;
}
边栏推荐
- cdc 能全量拉去oracle 表嘛
- Case of Jiecode empowerment: professional training, technical support, and multiple measures to promote graduates to build smart campus completion system
- Introduction to hashtable
- 也算是学习中的小总结
- CADD课程学习(7)-- 模拟靶点和小分子相互作用 (柔性对接 AutoDock)
- Easyrecovery靠谱不收费的数据恢复电脑软件
- 729. 我的日程安排表 I(set or 动态开点线段树)
- 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
- 关于imx8mp的es8316的芯片调试
猜你喜欢

Vulnerability discovery - vulnerability probe type utilization and repair of web applications

Guitar Pro 8.0最详细全面的更新内容及全部功能介绍

Redis - redis in action - redis actual combat - actual combat Chapter 1 - SMS login function based on redis - redis + token shared session application - with code

Postman断言

JVM garbage collector concept

A blog to achieve embedded entry

Orm-f & Q object

Programmers' position in the Internet industry | daily anecdotes
![[数学建模] 微分方程--捕鱼业的持续发展](/img/7c/2ab6f2a34bc2c97318537ec8e0b0c5.png)
[数学建模] 微分方程--捕鱼业的持续发展

Selection of slow motion function
随机推荐
newton interpolation
How do programmers teach their bosses to do things in one sentence? "I'm off duty first. You have to work harder."
Luogu deep foundation part 1 Introduction to language Chapter 2 sequential structure programming
Patent | subject classification method based on graph convolution neural network fusion of multiple human brain maps
Implementation of knowledge consolidation source code 1: epoll implementation of TCP server
MySQL reported an error datetime (0) null
[face recognition series] | realize automatic makeup
几种RS485隔离通讯的方案介绍
优秀PM必须经历这3层蜕变!
MPLS experiment
English Vocabulary - life scene memory method
Quick sort
关于es8316的音频爆破音的解决
2328. 网格图中递增路径的数目(记忆化搜索)
内核判断i2c地址上是否挂载外设
CADD course learning (7) -- Simulation of target and small molecule interaction (flexible docking autodock)
tengine 内核参数
The value of two date types is subtracted and converted to seconds
满足多元需求:捷码打造3大一站式开发套餐,助力高效开发
A blog to achieve embedded entry