您的答案為: 9314g 正確答案為: bye~Rabbit
您的答案為: 14670g
正確答案為: bye~Rabbit
while True:
try:
ccc=int(input())
for eikhab in range(ccc):
x,y,z,w,n,m=map(int,input().split())
a=list(map(int,input().split()))
drug=0
if a == []:
print('%dg'%m)
continue
for v in range(len(a)):
m=m-drug
if m <=0:
print('bye~Rabbit')
break
else:
if a[v] == 1:
m=m+x
elif a[v] == 2:
m=m+y
elif a[v] == 3:
m=m-z
elif a[v] == 0:
continue
else:
m=m-w
drug=drug+n
if m >0:
print('%dg'%m)
except:
break
#0: 10% WA (line:809)
您的答案為: 9314g 正確答案為: bye~Rabbit#1: 90% WA (line:451)
您的答案為: 14670g 正確答案為: bye~Rabbit
while True: try: ccc=int(input()) for eikhab in range(ccc): x,y,z,w,n,m=map(int,input().split()) a=list(map(int,input().split())) drug=0 if a == []: print('%dg'%m) continue for v in range(len(a)): m=m-drug if m <=0: print('bye~Rabbit') break else: if a[v] == 1: m=m+x elif a[v] == 2: m=m+y elif a[v] == 3: m=m-z elif a[v] == 0: continue else: m=m-w drug=drug+n if m >0: print('%dg'%m) except: break
你在吃黃蘿蔔和黑蘿蔔後也要檢查體重是否小於或等於零