当前位置:网站首页>[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;
}
边栏推荐
- 729. 我的日程安排表 I(set or 动态开点线段树)
- Certbot failed to update certificate solution
- How to estimate the population with samples? (mean, variance, standard deviation)
- Easyrecovery reliable and toll free data recovery computer software
- 我想问一下 按照现在mysql-cdc的设计,全量阶段,如果某一个chunk的binlog回填阶段,
- 【HBZ分享】云数据库如何定位慢查询
- Knowledge consolidation source code implementation 3: buffer ringbuffer
- JVM garbage collector concept
- 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
猜你喜欢

Database - MySQL storage engine (deadlock)

Etcd database source code analysis -- etcdserver bootstrap initialization storage

ISP学习(2)

Fuzzy -- basic application method of AFL

Use sentinel to interface locally

捷码赋能案例:专业培训、技术支撑,多措并举推动毕业生搭建智慧校园毕设系统

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

Sqlserver query results are not displayed in tabular form. How to modify them

麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
随机推荐
2328. 网格图中递增路径的数目(记忆化搜索)
It is also a small summary in learning
程序员在互联网行业的地位 | 每日趣闻
Scala function advanced
Case of Jiecode empowerment: professional training, technical support, and multiple measures to promote graduates to build smart campus completion system
Delete subsequence < daily question >
SharedPreferences 源码分析
C. The Third Problem(找规律)
Quatre méthodes de redis pour dépanner les grandes clés sont nécessaires pour optimiser
CADD course learning (8) -- virtual screening of Compound Library
Bubble sort
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
JVM garbage collector concept
Dry goods collection | Vulkan game engine video tutorial
Luogu deep foundation part 1 Introduction to language Chapter 2 sequential structure programming
Knowledge consolidation source code implementation 3: buffer ringbuffer
CertBot 更新证书失败解决
Redis - redis in action - redis actual combat - actual combat Chapter 1 - SMS login function based on redis - redis + token shared session application - with code
The implementation of the maize negotiable digital warehouse receipt standard will speed up the asset digitization process of the industry
How do programmers teach their bosses to do things in one sentence? "I'm off duty first. You have to work harder."