日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Diverse Team(CF-988A)

發布時間:2025/3/17 编程问答 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Diverse Team(CF-988A) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Problem Description

There are nn students in a school class, the rating of the i-th student on Codehorses is aiai. You have to form a team consisting of kk 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 kk 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 aiai 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?

題意:給出 n 個學生的成績,要在 n 個學生里選 k 個人組成一隊,要求 k 個人的成績均不相同,如果可以,輸出 YES 以及選的人的編號,如果不行,輸出 NO

思路:設置一標記數組,記錄分數不同的人的編號以及個數,如果小于 k,則輸出 NO,如果滿足條件,依次輸出即可。

Source Program

#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<cstdlib> #include<queue> #include<set> #include<map> #include<stack> #include<ctime> #include<vector> #define INF 0x3f3f3f3f #define PI acos(-1.0) #define N 10005 #define MOD 123 #define E 1e-6 using namespace std; int a[N]; int vis[N]; int ans[N]; int main() {int n,k;cin>>n>>k;int cnt=0;for(int i=1;i<=n;i++){cin>>a[i];if(!vis[a[i]])//如果分數未出現過{cnt++;//不同的分數+1ans[cnt]=i;//記錄位置}vis[a[i]]=1;//標記}if(cnt<k)//不同分數小于要求數cout<<"NO"<<endl;else{cout<<"YES"<<endl;for(int i=1;i<=k;i++)cout<<ans[i]<<" ";cout<<endl;}return 0; }

?

總結

以上是生活随笔為你收集整理的Diverse Team(CF-988A)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 日韩免费在线观看视频 | 香蕉久久国产av一区二区 | 午夜香蕉网 | 国产一级片一区 | 理论片国产 | 日韩一级影院 | 日批黄色片 | 黄色片在线视频 | 欧美性视频一区二区三区 | 毛片最新网址 | www.黄在线观看 | 色爱AV综合网国产精品 | av小说免费在线观看 | 99热99re6国产在线播放 | 欧美日韩一区视频 | 免费人成网站 | 免费成人美女在线观看. | 偷偷操av| 欧美 中文字幕 | 久久久成人精品 | 亚洲丁香 | 亚洲激情自拍偷拍 | 国产精品白嫩白嫩大学美女 | 鲁一鲁在线视频 | 亚洲精选久久 | 在线视频导航 | 芒果视频在线观看免费 | 一炮成瘾1v1高h | 在线看片一区二区 | 91色偷偷 | 超碰个人在线 | 麻豆成人在线观看 | 毛片官网 | 四虎午夜| 久久精品电影网 | 日韩av免费在线看 | 日韩美女在线 | 亚洲综合中文字幕在线 | 伊人网欧美 | 亚洲精品视频中文字幕 | 精品一区二区无码 | 91桃色污 | 国产深夜福利在线 | 在线看片你懂的 | 久久久久99精品成人片我成大片 | 女人张开腿让男人桶爽 | 麻豆av电影在线 | 粉色视频免费 | 99re这里都是精品 | 日本三级视频在线观看 | 色婷婷av一区 | 午夜黄色一级片 | 超碰人人在线观看 | 国产精品九九 | 欧美大片黄色 | √天堂8资源中文在线 | 欧美123区 | 免费超爽大片黄 | 亚洲最大激情网 | 五月激情综合网 | 国产精品国产一区二区三区四区 | 亚洲色偷偷色噜噜狠狠99网 | 久久久精品国产sm调教网站 | 婷婷影院在线观看 | 日本精品一二三 | 国产精品无码av在线播放 | 99综合在线 | 麻豆chinese新婚xxx | 不卡成人 | 人人人草| 亚洲一级二级三级 | 奇米在线| 久久成人人人人精品欧 | 无码国产精品一区二区色情男同 | 美女的胸给男人玩视频 | 亚洲综合欧美日韩 | 奇米影视狠狠 | 国模私拍视频在线 | 亚洲精品免费在线播放 | 国产在线色视频 | 天天插天天 | 一区二区国产欧美 | 亚洲成人自拍网 | 成人h在线| 天天视频国产 | 69xx国产| 欧美一页 | 国产成人欧美一区二区三区91 | 国产精品2019| 男男成人高潮片免费网站 | 成人免费一区二区三区在线观看 | 欧美丝袜脚交 | 18视频在线观看男男 | 久久人妻精品白浆国产 | 黄黄的视频在线观看 | 日本福利一区二区 | 少妇按摩一区二区三区 | av在线不卡免费看 | 久久高清国产 |