問題
回答
A,B,M = map(int,input().split())
a = list(map(int,input().split()))#冷蔵庫
b = list(map(int,input().split()))#電子レンジ
ans = min(a) + min(b)
for i in range(M):
x,y,c = map(int,input().split())
num = a[x-1] + b[y-1] - c
if ans > num:
ans = num
print(ans)
または
A,B,M = map(int,input().split())
a = list(map(int,input().split()))#冷蔵庫
b = list(map(int,input().split()))#電子レンジ
ans = min(a)+min(b)
for i in range(M):
x, y, c = map(int,input().split())
ans = min(ans,a[x-1]+b[y-1]-c)
print(ans)
ポイント
for文の中でx, y, c = map(int,input().split())
の標準入力を記載すること」。これが思いつかず。