Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- def main():
- in_file = open("perm.in", "r")
- n = int(in_file.readline())
- in_file.close()
- out_file = open("perm.out", "w")
- out_file.writelines(
- map(
- lambda permutation: " ".join(map(str, permutation)) + "\n",
- itertools.permutations(range(1, n + 1), n),
- ),
- )
- out_file.close()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement