It seems that there is a bug with python 3 lists for this puzzle, when I do the following, the code times out for all 3 submissions tests.
I think that the problem lies in the vaults list. I replaced it with a dictionnary and it worked like a charm. I thought that there was a problem at first with the values, so i tried to follow them step by step.
My conclusion from my tests is that the timeout happens when we want to add the last vault value in the list.>
vaults=dict()
#vaults=list()
print(“filling vaults”,file=sys.stderr)
for i in range(v):
c, n = [int(j) for j in input().split()]
print(“c”,file=sys.stderr)
print(c,file=sys.stderr)
print(“n”,file=sys.stderr)
print(n,file=sys.stderr)
print(“pow”,file=sys.stderr)
print(int(math.pow(5,c-n)*math.pow(10,n)),file=sys.stderr)
print(“vaults so far”,file=sys.stderr)
print(vaults,file=sys.stderr)
value=math.pow(5,c-n)*math.pow(10,n)
vaults[i]=value
#vaults.append(value)