There are n students in a school class, the rating of the i-th student on Codehorses is ai. You have to form a team consisting of k students ( 1≤k≤n

) such that the ratings of all team members are distinct.

If it is impossible to form a suitable team, print "NO" (without quotes). Otherwise print "YES", and then print k

distinct numbers which should be the indices of students in the team you form. If there are multiple answers, print any of them.

Input

The first line contains two integers n

and k ( 1≤k≤n≤100

) — the number of students and the size of the team you have to form.

The second line contains n

integers a1,a2,…,an ( 1≤ai≤100), where ai is the rating of i

-th student.

Output

If it is impossible to form a suitable team, print "NO" (without quotes). Otherwise print "YES", and then print k

distinct integers from 1 to n

which should be the indices of students in the team you form. All the ratings of the students in the team should be distinct. You may print the indices in any order. If there are multiple answers, print any of them.

Assume that the students are numbered from 1

to n

.

Examples
Input

Copy

5 3
15 13 15 15 12

Output

Copy

YES
1 2 5

Input

Copy

5 4
15 13 15 15 12

Output

Copy

NO

Input

Copy

4 4
20 10 40 30

Output

Copy

YES
1 2 3 4

Note

All possible answers for the first example:

  • {1 2 5}
  • {2 3 5}
  • {2 4 5}

Note that the order does not matter.

题意:一共给n个数,在n个数里找k个完全不相同的数,如果能找到,可以输出任意一组的下标,如果不能输出NO

思路:定义一个vis数组记录每个数字出现的下标,如果是0表示没有出现过,用type记录数字的种类,如果小于k则直接输出NO

代码:

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 105;
int vis[N];
int main(){int n,k;scanf("%d%d",&n,&k);int type=0;for(int i=0;i<n;i++){int x;scanf("%d",&x);if(!vis[x]){vis[x]=i+1;type++;}}if(type<k) printf("NO\n");else{printf("YES\n");int j=0;sort(vis,vis+101);for(int i=0;i<=100;i++)if(vis[i]){if(k==1) printf("%d\n",vis[i]);else if(k>1) printf("%d ",vis[i]);else break;k--;}}return 0;
}

Diverse Team(暴力)相关推荐

  1. Diverse Team(CF-988A)

    Problem Description There are nn students in a school class, the rating of the i-th student on Codeh ...

  2. Codeforces Round #486 (Div. 3)【完结】

    2022.3.2 题单地址:https://codeforces.com/contest/988 目录 A. Diverse Team[模拟] B. Substrings Sort[暴力枚举] C. ...

  3. 辍学的名人_我辍学去追求成为网络开发人员和设计师的梦想

    辍学的名人 by Carlos Sz 由Carlos Sz 我辍学去追求成为网络开发人员和设计师的梦想 (I dropped out of college to pursue my dreams of ...

  4. 加油python_力扣——gas station (加油站) python实现

    题目描述: 中文: 在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升. 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] ...

  5. 如何进入游戏行业_进入设计行业

    如何进入游戏行业 We're living in some weird-ass times. One of the unfortunate results of a global pandemic i ...

  6. 管道过滤模式 大数据_大数据管道配方

    管道过滤模式 大数据 介绍 (Introduction) If you are starting with Big Data it is common to feel overwhelmed by t ...

  7. 基础算法 —— 模拟思维

    [概述] 模拟,是根据实际问题建立模型,模拟实际按程序走一遍,最终求出答案. 思维,则是与逻辑思维有关,其需要针对题意.数据范围等抽丝剥茧抽离出有用的信息,从而得出一个结果. 对于一般的模拟,直接根据 ...

  8. 遇见OFFER,阿里云最强技术团队现身招聘,“职”为你来

    简历投递入口: https://bss.csdn.net/delivery/resume/ali 在5·15 遇见OFFER大厂梦招聘活动中,近20家企业来到CSDN[遇见OFFER]直播招聘栏目,其 ...

  9. 2020阿里招聘岗位要求

    简历投递入口: https://bss.csdn.net/delivery/resume/ali 职位名称 职位描述 职位要求 阿里云智能事业群-中间件业务中台架构师-北京\杭州 1.负责阿里云中台项 ...

  10. 性别歧义代词(GAP) 2019年 NLP 研讨会性别偏见问题共同任务--阅读笔记

    Gendered Ambiguous Pronouns (GAP) Shared Task at the Gender Bias in NLP Workshop 2019 https://www.ac ...

最新文章

  1. SAP Query达到select * where 的效果 2011-04-29
  2. 【Android 应用开发】BluetoothAdapter解析
  3. 检测子进程的结束返回状态,status的取值可以是哪些?(简析)
  4. [工具]再更新音乐下载软件,MP3音乐无损音乐下载器
  5. 聪明的木匠(优先队列,思维)
  6. Android之用adb screencap -p命令截图
  7. Qt工作笔记-ui文件连接信号与槽
  8. jQuery插件开发详细教程
  9. MySQL 到底能不能放到 Docker 里跑? 1
  10. linux/windows下代理软件对比分析
  11. 清明节如何计算(一千年清明节计算)
  12. Docker基础笔记
  13. Microsoft Edge 收藏夹如何显示在界面上方?
  14. Webstorm 分屏操作
  15. SpringBoot 重置 kafka 偏移量offset(kafka-0.10.1.0)
  16. solr中文同义词检索的配置讲解
  17. 解决google打开Github慢的问题,亲测有效
  18. C语言剖析OC的rangeOfString方法
  19. Android开发k歌软件,安卓电视k歌软件哪个好?
  20. SEO免费外链发布工具

热门文章

  1. 计算机职业道德核心价值观,信息技术学科的核心价值观再认识
  2. Floyd-Warshall算法过程中矩阵计算方法—十字交叉法(转)
  3. iOS 15 正式版发布,210 条改进大汇总
  4. HDU - 3966(树链剖分)
  5. 并行计算,网格计算与分布式计算的…
  6. Web中间件漏洞总结
  7. 凉州馆中与诸判官夜集
  8. 特征值分解:特征值,特征向量,特征向量矩阵
  9. 网络共享计算机权限访问,局域网共享时提示:你没有权限访问,请与网络管理员联系...
  10. Excel中如何使用COLUMN和COLUMNS函数