题解 | 小红的环形数组
小红的环形数组
https://www.nowcoder.com/practice/2094caa98e9c40fa8da8436ee7e232c6
A = list(map(int, input().split(" ")))
n = A[0]
o = A[1]
nums = list(map(int, input().split(" ")))
for i in range(o):
operate = input().split(" ")
start = int(operate[0])
step = int(operate[2])
if operate[1] == "R":
num = (step + start - 1)%n
elif operate[1] == "L":
num = (start - step - 1)%n
print(nums[num])

