#include <cstdio>
#include <vector>
using namespace std;
int main() {
  int n, t;
  scanf("%d", &n); scanf("%d", &t);
  int k = 1<<n;
  vector<int> l(k);
  for(int i=0; i<k; ++i)
    scanf("%d", &l[i]);
  if(t%2)
    for(auto it=l.rbegin(); it!=l.rend(); ++it)
      printf("%d ", *it);
  else
    for(int j: l)
      printf("%d ", j);
  puts("");
}
        | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <cstdio> #include <vector> using namespace std; int main() { int n, t; scanf("%d", &n); scanf("%d", &t); int k = 1<<n; vector<int> l(k); for(int i=0; i<k; ++i) scanf("%d", &l[i]); if(t%2) for(auto it=l.rbegin(); it!=l.rend(); ++it) printf("%d ", *it); else for(int j: l) printf("%d ", j); puts(""); } | 
 
            
         English
                    English