Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def play():
- global A
- global B
- if (A[0] > B[0] and not (A[0] == 9 and B[0] == 0)) or (A[0] == 0 and B[0] == 9):
- A.append(A[0])
- A.append(B[0])
- B.pop(0)
- A.pop(0)
- else:
- B.append(A[0])
- B.append(B[0])
- A.pop(0)
- B.pop(0)
- A = list(map(int, input().split()))
- B = list(map(int, input().split()))
- k = 0
- while len(A) != 0 and len(B) != 0:
- play()
- k += 1
- if k >= 10 ** 4:
- break
- if len(A) == 0:
- print('second', k)
- elif len(B) == 0:
- print('first', k)
- else:
- print('botva')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement