当前位置:网站首页>[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;
}
边栏推荐
- A blog to achieve embedded entry
- ISP学习(2)
- Microservice resource address
- 关于imx8mp的es8316的芯片调试
- SharedPreferences source code analysis
- Fedora/rehl installation semanage
- 动态规划(树形dp)
- [数学建模] 微分方程--捕鱼业的持续发展
- CADD course learning (7) -- Simulation of target and small molecule interaction (flexible docking autodock)
- Programmers' position in the Internet industry | daily anecdotes
猜你喜欢

程序员在互联网行业的地位 | 每日趣闻

Jd.com 2: how to prevent oversold in the deduction process of commodity inventory?

Fuzzy -- basic application method of AFL

CADD课程学习(8)-- 化合物库虚拟筛选(Virtual Screening)

电脑钉钉怎么调整声音

English Vocabulary - life scene memory method

Flink kakfa data read and write to Hudi

Database - MySQL storage engine (deadlock)

Yyds dry inventory automatic lighting system based on CC2530 (ZigBee)

DMA use of stm32
随机推荐
Redis —— Redis In Action —— Redis 实战—— 实战篇一 —— 基于 Redis 的短信登录功能 —— Redis + Token 的共享 session 应用— 有代码
力扣(LeetCode)186. 翻转字符串里的单词 II(2022.07.05)
2327. 知道秘密的人数(递推)
coreldraw2022新版本新功能介绍cdr2022
Introduction to hashtable
How does vs change the project type?
Platformio create libopencm3 + FreeRTOS project
Distributed transaction solution
Patent | subject classification method based on graph convolution neural network fusion of multiple human brain maps
newton interpolation
二叉树基本知识和例题
Hashlimit rate control
Project manager, can you draw prototypes? Does the project manager need to do product design?
ORM aggregate query and native database operation
关于imx8mp的es8316的芯片调试
1008 circular right shift of array elements (20 points)
Quick sort
Bubble sort
SQL注入漏洞(MSSQL注入)
Coreldraw2022 new version new function introduction cdr2022