题解 | 全排列

全排列

https://www.nowcoder.com/practice/1d1fe38275da44b5848add89f9e223b1

n=int(input())
list1=[i for i in range(1,n+1)]
from itertools import permutations
list2=list(permutations(list1))
for i in list2:
    print(' '.join(map(str,i)))

全部评论

相关推荐

牛客51274894...:照片认真的吗,找个专门拍证件照的几十块钱整端正点吧,要不就别加照片
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务