結果

問題 No.1676 Coin Trade (Single)
ユーザー 👑 tamatotamato
提出日時 2021-09-10 21:46:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 78,056 KB
最終ジャッジ日時 2023-09-02 16:44:11
合計ジャッジ時間 5,809 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,696 KB
testcase_01 AC 74 ms
71,752 KB
testcase_02 AC 71 ms
71,452 KB
testcase_03 AC 124 ms
77,544 KB
testcase_04 AC 125 ms
77,604 KB
testcase_05 AC 116 ms
77,820 KB
testcase_06 AC 122 ms
77,568 KB
testcase_07 AC 110 ms
77,264 KB
testcase_08 AC 103 ms
76,956 KB
testcase_09 AC 113 ms
77,424 KB
testcase_10 AC 113 ms
77,988 KB
testcase_11 AC 127 ms
77,900 KB
testcase_12 AC 107 ms
77,172 KB
testcase_13 AC 72 ms
71,624 KB
testcase_14 AC 74 ms
71,348 KB
testcase_15 AC 72 ms
71,660 KB
testcase_16 AC 71 ms
71,616 KB
testcase_17 AC 73 ms
71,712 KB
testcase_18 AC 72 ms
71,672 KB
testcase_19 AC 74 ms
71,344 KB
testcase_20 AC 74 ms
71,492 KB
testcase_21 AC 73 ms
71,888 KB
testcase_22 AC 72 ms
71,804 KB
testcase_23 AC 72 ms
71,416 KB
testcase_24 AC 73 ms
71,684 KB
testcase_25 AC 71 ms
71,452 KB
testcase_26 AC 71 ms
71,640 KB
testcase_27 AC 70 ms
71,420 KB
testcase_28 AC 71 ms
71,476 KB
testcase_29 AC 73 ms
71,476 KB
testcase_30 AC 72 ms
71,828 KB
testcase_31 AC 74 ms
71,524 KB
testcase_32 AC 73 ms
71,492 KB
testcase_33 AC 138 ms
78,056 KB
testcase_34 AC 138 ms
77,776 KB
testcase_35 AC 136 ms
78,020 KB
testcase_36 AC 137 ms
77,940 KB
testcase_37 AC 136 ms
78,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.buffer.readline

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


if __name__ == '__main__':
    main()
0