您的答案為: 6744g 正確答案為: bye~Rabbit
您的答案為: 30479g 正確答案為: 13011g
#0: 10% WA (line:1)
您的答案為: 6744g 正確答案為: bye~Rabbit#1: 90% WA (line:1)
您的答案為: 30479g 正確答案為: 13011g
x=y=z=w=n=m=0toxic=0day=[]time=int(input())def weight(c):if c==1:return xelif c==2:return yelif c==3:return -zelif c==4:return -welif c==0:return 0for i in range(time):x,y,z,w,n,m=map(int,(input().split(" ")))try:day=list(map(int,input().split(' ')))for t in day:m-=n*toxicif m<=0:print("bye~Rabbit")breakm+=weight(t)if m<=0:print("bye~Rabbit")breakif t==4:toxic+=1if m>0:print(f"{m}g")except:print(f"{m}g")break
我找到原因了,day=list(map(int,input().split(' ')))要改成day=list(map(int,input().split()))就AC了
#0: 10% WA (line:1)
您的答案為: 6744g 正確答案為: bye~Rabbit#1: 90% WA (line:1)
您的答案為: 30479g 正確答案為: 13011g
x=y=z=w=n=m=0toxic=0day=[]time=int(input())def weight(c):if c==1:return xelif c==2:return yelif c==3:return -zelif c==4:return -welif c==0:return 0for i in range(time):x,y,z,w,n,m=map(int,(input().split(" ")))try:day=list(map(int,input().split(' ')))for t in day:m-=n*toxicif m<=0:print("bye~Rabbit")breakm+=weight(t)if m<=0:print("bye~Rabbit")breakif t==4:toxic+=1if m>0:print(f"{m}g")except:print(f"{m}g")break我找到原因了,day=list(map(int,input().split(' ')))要改成day=list(map(int,input().split()))就AC了
實際上list(map(int,input().split(" ")))和list(map(int,input().split()))作用不是應該是一樣的嗎?為何前者不行?有高手能幫我解答嗎