Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stack>
- #include<math.h>
- #include<time.h>
- #include<iostream>
- #include<algorithm>
- #include<string>
- #include<set>
- #include<iomanip>
- #include<vector>
- #include<map>
- #include<cassert>
- #include<queue>
- #include <tuple>
- using namespace std;
- typedef long long li;
- typedef long double ld;
- #define forn(i, n) for (int i = 0; i < int(n); ++i)
- #define pb push_back
- #define mp make_pair
- #define shek_shek _DEBUG
- #define mt make_tuple
- #define aaaa(n) get<(n)>(aaaa)
- #define all(v) v.begin(),v.end()
- #define EPS 1e-9
- #define PI 3.1415926535897932384626433832795
- typedef long long li;
- typedef long double ld;
- typedef pair <int, int> pt;
- #define ALPH "123456789"
- #define DEPTH (9)
- char s[DEPTH];
- bool used[DEPTH];
- void rec (int x) {
- if (x == DEPTH) {
- printf("%s\n", s);
- return;
- }
- for (int i = 0; i < DEPTH; i++) {
- if (!used[i]) {
- used[i] = true;
- s[x] = ALPH[i];
- rec(x + 1);
- used[i] = false;
- }
- }
- }
- int main () {
- #ifdef shek_shek
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- rec(0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement