Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define ll long long
- #define ull unsigned long long
- #define nl cout<<"\n";
- #define sp cout<<" ";
- #define sz(x) x.size()
- #define NumOfDigit(w) log10(w) + 1
- #define fill(arr, val) memset(arr, val , sizeof(arr))
- #define PI 3.141592654
- #define modulo(a, b, mod) ((((a) % (mod)) + ((b) % (mod))) % (mod))
- #define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
- #define all(v) v.begin(), v.end()
- #define rall(v) v.rbegin(), v.rend()
- #define cin(v) for (auto&i:v) cin >> i;
- #define cout(v) for (auto&i:v) cout << i << " ";
- #define fixed(n) fixed << setprecision(n)
- #define fi first
- #define se second
- using namespace std;
- void zainab_hamdy(){
- ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- //freopen("collisions.in" , "r" ,stdin);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- bool prime(ll n){
- if(n==2 || n==3) return true;
- if(n<2 || n%2==0 ) return false;
- for(int i=3;i<=sqrt(n);i+=2) if(n%i==0) return false;
- return true;
- }
- bool comp(ll a , ll b){
- return a > b;
- }
- int main(){
- //zainab_hamdy();
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- ll n,k; cin >> n >> k;
- vector<pair<int,int>> v(n);
- for(int i=0;i<n;i++){
- cin >> v[i].first ;
- v[i].second=i+1;
- }
- sort(rall(v));
- vector<int> ans(k);
- //for(auto& i:v) cout << i.fi <<" " << i.se <<"\n";
- for(int i=0;i<k;i++)
- ans.push_back(v[i].second);
- sort(all(ans));
- for(auto& i:ans)if(i!=0) cout << i<<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement