mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 18:38:47 +00:00
3988. 不同的数
https://www.acwing.com/problem/content/submission/code_detail/7907500/
This commit is contained in:
parent
4370ffb409
commit
317db1d887
25
AcWing/3988/3988.cpp
Normal file
25
AcWing/3988/3988.cpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int n, k, i, a[105];
|
||||||
|
map<int, int> b;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cin >> n >> k;
|
||||||
|
for (int i = 1; i <= n; i++) {
|
||||||
|
cin >> a[i];
|
||||||
|
b[a[i]] = i;
|
||||||
|
}
|
||||||
|
if (b.size() < k) {
|
||||||
|
cout << "NO" << endl;
|
||||||
|
} else {
|
||||||
|
cout << "YES" << endl;
|
||||||
|
for (auto it : b) {
|
||||||
|
cout << it.second << ' ';
|
||||||
|
if (++i >= k) break;
|
||||||
|
}
|
||||||
|
cout << endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user