From 317db1d887537a85f297dec45588adeb37830a2a Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 25 Sep 2021 20:06:12 +0800 Subject: [PATCH] =?UTF-8?q?3988.=20=E4=B8=8D=E5=90=8C=E7=9A=84=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/7907500/ --- AcWing/3988/3988.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 AcWing/3988/3988.cpp diff --git a/AcWing/3988/3988.cpp b/AcWing/3988/3988.cpp new file mode 100644 index 00000000..2cdab528 --- /dev/null +++ b/AcWing/3988/3988.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +int n, k, i, a[105]; +map 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; +}