#14966:


410621208@gms.ndhu.edu.tw (123456)

學校 : 不指定學校
編號 : 74722
來源 : [101.12.16.135]
最後登入時間 :
2021-11-15 00:08:17
c094. 00661 - Blowing Fuses -- UVa661 | From: [220.130.182.222] | 發表日期 : 2018-08-23 19:11

try:
count = 0
while True:
count += 1
n,m,c = input().split()
n,m,c = int(n),int(m),int(c)
if n == 0 and m == 0 and c == 0:
break
listelec = []
listflag = []
for i in range(n):
elec = int(input())
listelec.append(elec)
listflag.append(0)
result = 0
maxpow = 0
for i in range(m):
num = int(input())
if listflag[num - 1] == 0:
result += listelec[num - 1]
listflag[num - 1] = 1
else:
result -= listelec[num - 1]
listflag[num - 1] = 0
#print(maxpow)
if int(result) > maxpow:
maxpow = result
#print("f")
if result > int(c):
print("Sequence "+str(count)+"\nFuse was blown.")
else:
print("Sequence "+str(count)+\
"\nFuse was not blown.\nMaximal power consumption was",maxpow,"amperes.")
print(end="\n")
except:
pass

 

請問我的code為什麼uva給過但zero給OLE,可以請大大解惑嗎??

 
ZeroJudge Forum