-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeforce988A.java
More file actions
30 lines (29 loc) · 856 Bytes
/
Copy pathCodeforce988A.java
File metadata and controls
30 lines (29 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.HashSet;
import java.util.Scanner;
public class Codeforce988A {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int k = input.nextInt();
HashSet<Integer> dis = new HashSet<>();
StringBuilder out = new StringBuilder();
int count = 0;
for (int i = 0; i < n; i++) {
int val = input.nextInt();
if (!dis.contains(val)) {
out.append(i+1).append(" ");
count++;
dis.add(val);
}
if (count == k){
break;
}
}
if (count == k){
System.out.println("YES");
System.out.println(out.toString().trim());
}else{
System.out.println("NO");
}
}
}