SHARE
TWEET

Untitled

a guest Oct 21st, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <algorithm>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     ifstream in("antiqs.in");
  10.     ofstream out("antiqs.out");
  11.     int n;
  12.     in >> n;
  13.     int M[n];
  14.     for(int i = 1; i < n + 1; i++)
  15.         M[i - 1] = i;
  16.     for(int i = 0; i < n; i++)
  17.         swap(M[i],M[i/2]);
  18.     for(int i = 0; i < n; i++)
  19.         out << M[i] << ' ';
  20.     return 0;
  21. }
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