Submission #10673692


Source Code Expand

Copy
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

NA,NB,M = map(int,readline().split())
A = list(map(int,readline().split()))
B = list(map(int,readline().split()))
m = map(int,read().split())
XYC = list(zip(m,m,m))

def gen_cand():
    yield min(A) + min(B)
    for x,y,c in XYC:
        yield A[x-1] + B[y-1] - c

answer = min(gen_cand())
print(answer)

Submission Info

Submission Time
Task B - Nice Shopping
User maspy
Language Python3 (3.4.3)
Score 200
Code Size 437 Byte
Status
Exec Time 192 ms
Memory 43548 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00_sample_01, 00_sample_02, 00_sample_03
All 200 / 200 00_sample_01, 00_sample_02, 00_sample_03, 02_maxsize_01, 02_maxsize_02, 02_onecase_01, 02_onecase_02, 02_random_01, 02_random_02, 03_ansbig_01, 03_ansbig_02, 04_ansmax_01, 04_ansmax_02, 05_oneticket_01, 05_oneticket_02, 90_handmake_01, 90_handmake_02
Case Name Status Exec Time Memory
00_sample_01 17 ms 3064 KB
00_sample_02 17 ms 3064 KB
00_sample_03 17 ms 3060 KB
02_maxsize_01 181 ms 43548 KB
02_maxsize_02 185 ms 43548 KB
02_onecase_01 65 ms 16252 KB
02_onecase_02 64 ms 16252 KB
02_random_01 125 ms 30700 KB
02_random_02 146 ms 36280 KB
03_ansbig_01 181 ms 42716 KB
03_ansbig_02 192 ms 42724 KB
04_ansmax_01 179 ms 36104 KB
04_ansmax_02 181 ms 36088 KB
05_oneticket_01 185 ms 36120 KB
05_oneticket_02 189 ms 36128 KB
90_handmake_01 17 ms 3064 KB
90_handmake_02 17 ms 3060 KB