結果

問題 No.1676 Coin Trade (Single)
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-10 23:03:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 12,124 KB
最終ジャッジ日時 2023-09-02 20:57:21
合計ジャッジ時間 5,966 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,908 KB
testcase_01 AC 15 ms
7,772 KB
testcase_02 AC 15 ms
7,808 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 141 ms
9,276 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 16 ms
7,908 KB
testcase_14 WA -
testcase_15 AC 16 ms
7,824 KB
testcase_16 WA -
testcase_17 AC 16 ms
7,956 KB
testcase_18 AC 15 ms
7,900 KB
testcase_19 WA -
testcase_20 AC 15 ms
7,904 KB
testcase_21 AC 15 ms
7,988 KB
testcase_22 WA -
testcase_23 AC 16 ms
7,840 KB
testcase_24 AC 16 ms
7,836 KB
testcase_25 AC 15 ms
7,808 KB
testcase_26 AC 15 ms
7,912 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 16 ms
7,820 KB
testcase_30 AC 15 ms
7,904 KB
testcase_31 AC 15 ms
7,972 KB
testcase_32 AC 16 ms
7,836 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 267 ms
12,072 KB
testcase_36 WA -
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

N, K = map(int, input().split())
dp = [-10 ** 9] * (N + 1)
dp[0] = 0
for i in range(1, N+1):
    A, M = map(int, input().split())
    B = list(map(int, input().split()))
    dp[i] = dp[0] - A

    res = dp[0]
    for b in B:
        res = max(res, A + dp[b])
    dp[0] = res

print(dp[0])
0