#include <stdio.h>
#include <vector>
using namespace std;
int main() {
	int potega;
	int ilosc_sortowan;
	vector<int> liczby;
	int tmp;
	printf("%i %i", &potega, &ilosc_sortowan);
	int ilosc_danych = 2 << (potega-1);
	for (int i = 0; i < ilosc_danych; i++) {
		printf("%d", &tmp);
		liczby.push_back(tmp);
	}
	if (ilosc_sortowan!=1 && ilosc_sortowan % 2)
		for (auto i : liczby) printf("%d ", i);
	else
		for (int i = ilosc_danych-1; i >= 0;i--) printf("%d ", liczby.at(i));
}
        | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include <stdio.h> #include <vector> using namespace std; int main() { int potega; int ilosc_sortowan; vector<int> liczby; int tmp; printf("%i %i", &potega, &ilosc_sortowan); int ilosc_danych = 2 << (potega-1); for (int i = 0; i < ilosc_danych; i++) { printf("%d", &tmp); liczby.push_back(tmp); } if (ilosc_sortowan!=1 && ilosc_sortowan % 2) for (auto i : liczby) printf("%d ", i); else for (int i = ilosc_danych-1; i >= 0;i--) printf("%d ", liczby.at(i)); } | 
 
            
         English
                    English