Advertisement
SY573M_404

C

Jun 3rd, 2023
877
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import itertools
  2.  
  3. def main():
  4.     in_file = open("choose.in", "r")
  5.     n, k = map(int, in_file.readline().split(" "))
  6.     in_file.close()
  7.  
  8.     out_file = open("choose.out", "w")
  9.     out_file.writelines(
  10.         map(
  11.             lambda permutation: " ".join(map(str, permutation)) + "\n",
  12.             itertools.combinations(range(1, n + 1), k),
  13.         ),
  14.     )
  15.     out_file.close()
  16.  
  17. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement