PAT icon indicating copy to clipboard operation
PAT copied to clipboard

提供乙级1008 python版本的PythonIC风格代码

Open 3000ye opened this issue 3 years ago • 0 comments

虽然比仓库里的代码要多几行,但是更加符合PythonIC风格规范

#!/usr/bin/python3.8
# Author: ye_3000
# Created Time: 2022-07-06


n, m = list(map(int, input().split()))
ls = list(input().split())


m %= n
ls[:] = ls[:: -1]
ls[:m] = ls[:m][:: -1]
ls[m:] = ls[m:][:: -1]

print(" ".join(ls))

3000ye avatar Jul 13 '22 16:07 3000ye