解题思路:
注意事项:
参考代码:
N,NA,NB = map(int,input().split()) la = list(map(int,input().split())) lb = list(map(int,input().split())) # A的出拳过程(利用商和余数拼接列表) a = la * (N // len(la)) + la[:N % len(la):] # B的出拳过程 b = lb * (N // len(lb)) + lb[:N % len(lb):] A = B = 0 # 依次比较每一次出拳 for i in range(len(a)): if (a[i] == 0 and b[i] == 2) or (a[i] == 2 and b[i] == 5) or (a[i] == 5 and b[i] == 0): A += 1 elif (b[i] == 0 and a[i] == 2) or (b[i] == 2 and a[i] == 5) or (b[i] == 5 and a[i] == 0): B += 1 if A == B: print("draw") elif A > B: print("A") else: print("B")
0.0分
4 人评分