測試執行的時候是AC
但送出答案是NA~
請問何處出了問題?
感謝~~
import sys
for line in sys.stdin:
if line.split():
n=int(line)
x=[0]*3
countK=0
for i in range(n):
sdata=sys.stdin.readline()
sdata=sdata.replace("\r","").replace("\n","")
move=str(sdata)
if move=="Get_Kill":
x[0] += 1
countK += 1
if x[0]>=8 :
print("LEGENDARY!")
elif x[0]==3 :
print("KILLING SPREE!")
elif x[0]==4 :
print("RAMPAGE~")
elif x[0]==5 :
print("UNSTOPPABLE!")
elif x[0]==6 :
print("DOMINATING!")
elif x[0]==7 :
print("GUALIKE!")
else:
print("You have slain an enemie.")
elif move=="Die":
x[1] += 1
if x[0]<3:
print("You have been slained.")
else:
print("SHUTDOWN.")
x[0]=0
else:
x[2] += 1
print("%d/%d/%d"%(countK,x[1],x[2]))
最大的問題應該是:每行測資除了文字和換行符號外,後面還有至少一個的空白符號,導致你的判斷式 move=="XXX"
都失準