Problem Statement

NN examinees took an entrance exam.
The examinee numbered ii scored A_iAi​ points in math and B_iBi​ points in English.

The admissions are determined as follows.

  1. XX examinees with the highest math scores are admitted.
  2. Then, among the examinees who are not admitted yet, YY examinees with the highest English scores are admitted.
  3. Then, among the examinees who are not admitted yet, ZZ examinees with the highest total scores in math and English are admitted.
  4. Those examinees who are not admitted yet are rejected.

Here, in each of the steps 1. to 3., ties are broken by examinees' numbers: an examinee with the smaller examinee's number is prioritized. See also Sample Input and Output.

Print the examinees' numbers of the admitted examinees determined by the steps above in ascending order, separated by newlines.

Constraints

  • All values in input are integers.
  • 1 \le N \le 10001≤N≤1000
  • 0 \le X,Y,Z \le N0≤X,Y,Z≤N
  • 1 \le X+Y+Z \le N1≤X+Y+Z≤N
  • 0 \le A_i,B_i \le 1000≤Ai​,Bi​≤100

Input

Input is given from Standard Input in the following format:

NN XX YY ZZ
A_1A1​ A_2A2​ \dots… A_NAN​
B_1B1​ B_2B2​ \dots… B_NBN​

Output

Print the examinees' number of the admitted examinees in ascending order, separated by newlines.


Sample Input 1 Copy

6 1 0 2
80 60 80 60 70 70
40 20 50 90 90 80

Sample Output 1 Copy

1
4
5

结构体的使用

找出最大n个数字的

#include<stdio.h>
int main()
{int n,x,y,z;scanf("%d %d %d %d",&n,&x,&y,&z);int a[1002],b[1002];int i;for(i=1;i<=n;i++){scanf("%d",&a[i]);}for(i=1;i<=n;i++){scanf("%d",&b[i]);}int j,dz[1002],k=0,max,dZ;while(x--){//找出最大X个数字//for(i=1;i<n;i++){max=1;for(j=2;j<=n;j++){if(a[max]<a[j])max=j;//存储最大数字的下标号}dz[k++]=max;a[max]=-1,b[max]=-1;//这个值去除掉//}}while(y--){//for(i=1;i<n;i++){max=1;for(j=2;j<=n;j++){if(b[max]<b[j])max=j;}dz[k++]=max;a[max]=-1,b[max]=-1;//}}while(z--){//for(i=1;i<n;i++){max=1;for(j=2;j<=n;j++){if(a[max]+b[max]<a[j]+b[j])max=j;}dz[k++]=max;a[max]=-1,b[max]=-1;//}}for( i=0;i<k-1;i++){for(j=0;j<k-i-1;j++){if(dz[j]>dz[j+1]){int t; t=dz[j];dz[j]=dz[j+1];dz[j+1]=t;}}}for(i=0;i<k;i++)printf("%d\n",dz[i]);return 0;
}

B - Better Students Are Needed!相关推荐

  1. AtCoder Beginner Contest 260 A~F 题解

    ABC260 A~F [A - A Unique Letter](https://atcoder.jp/contests/abc260/tasks/abc260_a) 题目大意 输入格式 输出格式 样 ...

  2. libc.so.6 is needed by mysql_libc.so.6(GLIBC_2.14)(64bit) is needed by…问题的解决办法

    在使用Linux服务器过程中,是否有遇到过"libc.so.6(GLIBC_2.14)(64bit) is needed by-"的问题,像小编就遇到了类似的问题: 安装rpm - ...

  3. 解决:Error: Insufficient values in manual scale. 5 needed but only 4 provided.Run `rlang::last_error()

    解决:Error: Insufficient values in manual scale. 5 needed but only 4 provided.Run `rlang::last_error() ...

  4. HDU 2444 The Accomodation of Students (二部图+染色)

    The Accomodation of Students Time Limit : 5000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Ja ...

  5. libc.so.6(GLIBC_2.14)(64bit) is needed by...问题的解决办法

    在使用Linux服务器过程中,是否有遇到过"libc.so.6(GLIBC_2.14)(64bit) is needed by..."的问题,像小编就遇到了类似的问题: 安装rpm ...

  6. pythreejs is needed for plotting with pythreejs backend

    pythreejs is needed for plotting with pythreejs backend 找到代码: https://github.com/daavoo/pyntcloud/bl ...

  7. to make target ‘../../lib/aaaaa.so‘, needed by ‘ xxx ‘

    ndk编译报错: to make target '../../lib/aaaaa.so', needed by ' xxx ' 我这原因是lib下缺少文件 aaaaa.so 解决方法: 找到aaaaa ...

  8. one of the variables needed for gradient computation has been modified by an inplace operation

    参考:https://www.cnblogs.com/liangzp/p/9207979.html 使用一个pytorch写的模型时,报错:RuntimeError:one of the variab ...

  9. one of the variables needed for gradient computation has been modified by an inplace

    one of the variables needed for gradient computation has been modified by an inplace 参考:https://blog ...

最新文章

  1. 使用javascript模拟常见数据结构(二)
  2. AWS工具boto3使用笔记
  3. 一文带你了解 FPGA
  4. 借助亚马逊S3和RapidMiner将机器学习应用到文本挖掘
  5. ie8以下 es5常见的数组遍历方法不可用的解决方案 forEach,map,filter,some,every
  6. C# 托管资源和非托管资源(Dispose、析构函数)
  7. git 命令行(一)-版本回退
  8. SAP License:创建新的库存地点
  9. cocos2dx对于强大的RichText控制
  10. vscode不能跳转_vscode-goto-node-modules 一个快速定位 node 模块的 vscode 插件
  11. 算法的优缺点_朴素贝叶斯算法的优缺点
  12. 完善的IaaS云服务的个人理解
  13. Mac安装MySQL8碰到的问题
  14. 2020软考论文想要拿高分,要避开这些坑!
  15. Unity之UnityWebRequest和使用
  16. 计算机系统内部存储器的存储单元,内部存储器练习
  17. 什么是beacons - 在Web Analytics中的应用(网站分析的灯塔)
  18. varnish 高性能加速器
  19. 如何查看自己电脑应该买什么样的内存条
  20. micropython 常量_MicroPython添加Module(二)

热门文章

  1. 怎样把网页保存为pdf?+如何删除pdf上面的某些东西
  2. 生成小程序太阳码-微信文档错误
  3. 第二版:JAVA对象对比VO对象找出差异值结合swagger-ApiModel无需自定义注解
  4. 爬虫爬取数据时各种中文乱码问题
  5. 【GNN】图技术在美团外卖下的场景化应用及探索
  6. React developer tools调试工具下载及安装教程
  7. 泊松过程中各个事件持续时间之和的期望
  8. 无法进入bios,bios黑屏,无法进入pe如何解决
  9. mysql连接失败HikariPool错误
  10. spring自动装配Bean的五种方式