SHARE
TWEET

codeforce - Slightly Decreasing Permutations

jakaria_hossain Apr 3rd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL));
  4. int main()
  5. {
  6.     fastread()
  7.     int n,k;
  8.     cin>>n>>k;
  9.     for(int i=0;i<k;i++)printf("%d ",n-i);
  10.     printf("1");
  11.     for(int i=2;i<=n-k;i++)printf(" %d",i);
  12.     printf("\n");
  13.     return 0;
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top