Problem p02748 (python)

Fixed submission:
a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]
import numpy as np


from collections import deque
ans = []

ans = deque(ans)

for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

ans = list(ans)

print(min( min(ans), min(a1)+min(b1) ))

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]
import numpy as np



from collections import deque
ans = []
ans = deque(ans)

for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

b2 = np.array(b1)
a2 = np.array(a1)
a2 = a2.reshape(a,1)

ans = list(ans)

print(min( min(ans), np.min(np.min(a2+b2) )))

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]
import numpy as np



from collections import deque
ans = []
ans = deque(ans)

for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

b2 = np.array(b1)
a2 = np.array(a1)
a2 = a2.reshape(a,1)
ans = list(ans)
print(min( min(ans), np.min(a2+b2) ))

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]
import numpy as np

b2 = np.array(b1)
a2 = np.array(a1)
a2 = a2.reshape(a,1)

from collections import deque
ans = []
ans = deque(ans)

for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

ans = list(ans)
print(min( min(ans), np.min(a2+b2) ))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]

import itertools
import numpy as np

b2 = np.array(b1)
b2 = np.tile(b2, (a,1))

ans = []
from collections import deque
ans = deque(ans)

for i in range(a):
    ans.append( np.min( b2[i] + np.tile(a1[i], b) ) )


for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

ans = list(ans)
print(min(ans))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**11)

a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]

import itertools
import numpy as np

b2 = np.array(b1)
b2 = np.tile(b2, (a,1))

ans = []
from collections import deque
ans = deque(ans)

for i in range(a):
    ans.append( np.min( b2[i] + np.tile(a1[i], b) ) )


for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

ans = list(ans)
print(min(ans))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]

import itertools
import numpy as np

b2 = np.array(b1)
b2 = np.tile(b2, (a,1))

ans = []
from collections import deque
ans = deque(ans)

for i in range(a):
    ans.append( np.min( b2[i] + np.tile(a1[i], b) ) )


for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

ans = list(ans)
print(min(ans))

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]

import itertools
import numpy as np

b2 = np.array(b1)
b2 = np.tile(b2, (a,1))

ans = []
from collections import deque
ans = deque(ans)

for i in range(a):
    ans.append( min( b2[i] + np.tile(a1[i], b) ) )


for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

ans = list(ans)
print(min(ans))

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))

disc = [list(map(int, input().split())) for i in range(m)]

import itertools
import numpy as np

b2 = np.array(b1)
b2 = np.tile(b2, (a,1))

for i in range(a):
    b2[i] = b2[i] + np.tile(a1[i], b)


ans = []
from collections import deque
ans = deque(ans)
for i in range(m):
    ans.append( a1[disc[i][0]-1] + b1[disc[i][1]-1] - disc[i][2] )

ans = list(ans)
print(min(np.min(b2), min(ans)))