Bank robbers: potential bug with python 3 lists

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)

I’ve just copy-pasted your code in the IDE and it “works”. It obviously doesn’t pass any test since you are not printing any answer at the end, but it doesn’t timeout either.

import sys
import math

r = int(input())
v = int(input())

#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)

print("1")

This is weird