Pagini recente » Cod sursa (job #746490) | Cod sursa (job #2267258) | Cod sursa (job #694184) | Cod sursa (job #1828652) | Cod sursa (job #3212464)
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define dbg(x) cout << #x << ": " << x << "\n";
#define sz(x) ((int)x.size())
using ll = long long;
const string fn = "permutari";
ifstream fin(fn + ".in");
ofstream fout(fn + ".out");
int n;
bitset<2000005> v;
int main()
{
fin >> n;
vector<int> v;
for (int i = 1; i <= n; ++i)
v.pb(i);
do
{
for (auto i : v)
fout << i << ' ';
fout << '\n';
} while (next_permutation(v.begin(), v.end()));
return 0;
}