Advertisement
mhdew

CF 486A

Jun 1st, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. ///Template
  6. #define in1() freopen("E:\\Random Programs\\template\\test_input.txt", "r", stdin)
  7. #define out1() freopen("E:\\Random Programs\\template\\test_output.txt", "w", stdout)
  8. #define in2(f) freopen("f", "r", stdin)
  9. #define out2(f) freopen("f", "w", stdout)
  10.  
  11. //Datatypes
  12. #define l long
  13. #define ll long long
  14. #define llu unsigned long long
  15.  
  16. //loop
  17. #define f1(i,x,y) for(int i=x;i<=y;i++)
  18.  
  19. bool flag[111];
  20.  
  21. int main()
  22. {
  23. //in1();
  24. //out1();
  25. int n, k;
  26. cin>>n>>k;
  27. int a[111];
  28. vector<int> v;
  29.  
  30. f1(i,1,n){
  31. cin>>a[i];
  32.  
  33. if(flag[a[i]]==0){
  34. v.push_back(i);
  35. flag[a[i]]=1;
  36. }
  37. }
  38.  
  39. int m=v.size();
  40.  
  41. if(m<k) cout<<"NO"<<endl;
  42. else{
  43. cout<<"YES"<<endl;
  44. for(int i=0;i<k;i++){
  45. cout<<v[i];
  46. if(i==k-1) cout<<endl;
  47. else cout<<" ";
  48. }
  49. }
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement