def move(location,right):
if location==L:
right=0
if location==0:
right=1
if right==1:
location+=1
else:
location-=1
return location,right
def bomb(right1,right2):
right1=int(not right1)
right2=int(not right2)
return right1,right2
n,L,t=list(map(int,input().split()))
a=list(map(int,input().split()))
right=[1]*n
for i in range(t):
for i in range(n):
for j in range(i+1,n):
if a[i]==a[j]:
right[i],right[j]=bomb(right[i],right[j])
for i in range(n):
a[i],right[i]=move(a[i],right[i])
for each in a:
print(each,end=' ')
CCFCSP 201803-2 碰撞的小球(Python)
最新推荐文章于 2024-07-22 22:58:19 发布