Problem description

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

5 3
15 13 15 15 12

Output

YES
1 2 5

Input

5 4
15 13 15 15 12

Output

NO

Input

4 4
20 10 40 30

Output

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个学生中找出k个不同的数字,如果有输出"YES",并且依次输出他们的序号,否则输出"NO",简单水过!

AC代码:

 #include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,x,m=,a[],b[];bool flag;//a数组存放不重复的元素,b数组记录每个元素的位置
cin>>n>>k;
for(int i=;i<=n;++i){
cin>>x;flag=false;
for(int j=;j<m;++j)
if(a[j]==x){flag=true;break;}
if(!flag){b[m]=i;a[m++]=x;}
}
if(m>=k){
cout<<"YES"<<endl;
for(int i=;i<k;++i)
cout<<b[i]<<(i==k-?"\n":" ");
}
else cout<<"NO"<<endl;
return ;
}

A - Diverse Team的更多相关文章

  1. Codeforces Round #486 (Div. 3) A. Diverse Team

    Codeforces Round #486 (Div. 3) A. Diverse Team 题目连接: http://codeforces.com/contest/988/problem/A Des ...

  2. 微软职位内部推荐-SENIOR PRODUCER

    微软近期Open的职位: Role Based in Shanghai, ChinaTitle: ProducerWe are seeking a Senior Producer to lead Pr ...

  3. Configure a VLAN on top of a team with NetworkManager (nmcli) in RHEL7

    SOLUTION VERIFIED September 13 2016 KB1248793 Environment Red Hat Enterprise Linux 7 NetworkManager ...

  4. Create a Team in RHEL7

    SOLUTION VERIFIED September 13 2016 KB2620131 Environment Red Hat Enterprise Linux 7 NetworkManager ...

  5. Team Leader 你不再只是编码, 来炖一锅石头汤吧

    h3{ color: #000; padding: 5px; margin-bottom: 10px; font-weight: bolder; background-color: #ccc; } h ...

  6. Configure bridge on a team interface using NetworkManager in RHEL 7

    SOLUTION IN PROGRESS February 29 2016 KB2181361 environment Red Hat Enterprise Linux 7 Teaming,Bridg ...

  7. BZOJ 4742: [Usaco2016 Dec]Team Building

    4742: [Usaco2016 Dec]Team Building Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 21  Solved: 16[Su ...

  8. 关于 feature team 的一些内容

    矩阵式管理,是常见的经典管理架构.其最早起源于美国的航空航天部门,然后被美国人带到了日本,然后被日本人带到了台湾,然后台湾人带到大陆...矩阵管理最典型的特征是,组织架构按职能与专业划分,项目由跨越部 ...

  9. 病毒四度升级:安天AVL Team揭露一例跨期两年的电信诈骗进化史

    自2014年9月起,安天AVL移动安全团队持续检测到一类基于Android移动平台的间谍类病毒,病毒样本大多伪装成名为"最高人民检察院"的应用.经过反编译逆向分析以及长期的跟踪调查 ...

随机推荐

  1. python SQLALchemy连接数据库。

    一.ORM与SQLALchemy简介 ORM 全程object Relational Mapping,对象关系映射.简单的说,ORM将数据库中的表与面向对象中的类建立了一种对应关系.这样在操作数据库时 ...

  2. 安卓手机安装charles安全证书

    本次安装使用小米mix2为例. 手机浏览器上安装: 第一种: 1.首先 设置好手机的charles代理   172.16.xxx.xxx   8888 2.要使用 打开非自带浏览器(夸克/QQ/UC手 ...

  3. 入口文件 index.php

    一. 运行流程 The index.php serves as the front controller, initializing the base resources needed to run ...

  4. Django REST framework 初识

    一.官网快速实例 quickstart # 安装 RESTful pip install djangorestframework 二.序列化 models.py from django.db impo ...

  5. Laravel-Action 对代码的改造

    前言 以往写过俩篇文章[积德篇] 如何少写PHP "烂"代码 https://segmentfault.com/a/11...举枪消灭"烂代码"的实战案例 ht ...

  6. 手机版地图api

    手机版地图api一: <iframe style="height:300px;" src="http://map.baidu.com/mobile/webapp/s ...

  7. sql 区分大小写查询

    sql 区分大小写查询 select * FROM [Users] where userName collate Chinese_PRC_CS_AS='ADMIN'

  8. everyday two problems / 3.1

    T1.string 题意: 给定由小写字母组成的长度为 n 的字符串 将其所有 n * (n + 1) / 2 个子串按字典序排序 输出第 k 个子串 k > (n * (n + 1) / 2) ...

  9. dataguard switchover to physical stnadby

    首先做一系列的check check 当前primary 的 standby redo log是否存在 SQL> select * from v$logfile; GROUP# STATUS T ...

  10. CCEditBox/CCEditBoxImplMac

    #ifndef __CCEditBoxIMPLMAC_H__ #define __CCEditBoxIMPLMAC_H__ #include "cocos2d.h" #if (CC ...