提出 #10683462


ソースコード 拡げる

#!/usr/bin/env python3

def main():
    A, B, M = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    x = [0] * M
    y = [0] * M
    c = [0] * M
    for i in range(M):
        x[i], y[i], c[i] = map(int, input().split())

    # without discount
    total = min(a) + min(b)

    # with discount
    for i in range(M):
        t = a[x[i] - 1] + b[y[i] - 1] - c[i]
        if t < total:
            total = t

    print(total)

main()

提出情報

提出日時
問題 B - Nice Shopping
ユーザ kotarot
言語 Python (3.4.3)
得点 200
コード長 515 Byte
結果 AC
実行時間 377 ms
メモリ 23396 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 17
セット名 テストケース
Sample 00_sample_01, 00_sample_02, 00_sample_03
All 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
ケース名 結果 実行時間 メモリ
00_sample_01 AC 17 ms 3064 KiB
00_sample_02 AC 17 ms 3064 KiB
00_sample_03 AC 17 ms 3064 KiB
02_maxsize_01 AC 377 ms 23396 KiB
02_maxsize_02 AC 376 ms 23340 KiB
02_onecase_01 AC 65 ms 18684 KiB
02_onecase_02 AC 65 ms 18684 KiB
02_random_01 AC 256 ms 17764 KiB
02_random_02 AC 321 ms 18984 KiB
03_ansbig_01 AC 363 ms 22576 KiB
03_ansbig_02 AC 377 ms 22548 KiB
04_ansmax_01 AC 363 ms 20304 KiB
04_ansmax_02 AC 360 ms 20280 KiB
05_oneticket_01 AC 370 ms 20300 KiB
05_oneticket_02 AC 360 ms 20296 KiB
90_handmake_01 AC 17 ms 3064 KiB
90_handmake_02 AC 17 ms 3064 KiB