結果

問題 No.1676 Coin Trade (Single)
ユーザー 👑 KazunKazun
提出日時 2021-09-10 22:36:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 79,436 KB
最終ジャッジ日時 2023-09-02 19:11:54
合計ジャッジ時間 6,633 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,028 KB
testcase_01 AC 74 ms
71,064 KB
testcase_02 AC 73 ms
70,916 KB
testcase_03 AC 126 ms
78,148 KB
testcase_04 AC 122 ms
78,216 KB
testcase_05 AC 118 ms
78,044 KB
testcase_06 AC 118 ms
77,880 KB
testcase_07 AC 114 ms
77,648 KB
testcase_08 AC 101 ms
77,080 KB
testcase_09 AC 114 ms
77,756 KB
testcase_10 AC 114 ms
77,984 KB
testcase_11 AC 127 ms
78,596 KB
testcase_12 AC 104 ms
77,508 KB
testcase_13 AC 73 ms
71,292 KB
testcase_14 AC 73 ms
71,024 KB
testcase_15 AC 72 ms
71,072 KB
testcase_16 AC 73 ms
71,124 KB
testcase_17 AC 72 ms
71,220 KB
testcase_18 AC 74 ms
70,944 KB
testcase_19 AC 74 ms
71,240 KB
testcase_20 AC 74 ms
71,176 KB
testcase_21 AC 73 ms
71,072 KB
testcase_22 AC 72 ms
71,044 KB
testcase_23 AC 73 ms
71,244 KB
testcase_24 AC 72 ms
71,044 KB
testcase_25 AC 72 ms
71,276 KB
testcase_26 AC 73 ms
71,280 KB
testcase_27 AC 72 ms
70,808 KB
testcase_28 AC 74 ms
71,136 KB
testcase_29 AC 72 ms
71,248 KB
testcase_30 AC 73 ms
71,148 KB
testcase_31 AC 73 ms
71,048 KB
testcase_32 AC 72 ms
70,940 KB
testcase_33 AC 135 ms
79,316 KB
testcase_34 AC 135 ms
79,264 KB
testcase_35 AC 134 ms
79,436 KB
testcase_36 AC 136 ms
79,232 KB
testcase_37 AC 136 ms
79,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline

N,K=map(int,input().split())

A=[0]*(N+1); M=[0]*(N+1)
B=[[]]

DP=[0]*(N+1)
for i in range(1,N+1):
    A[i],M[i]=map(int,input().split())
    DP[i]=DP[i-1]

    for b in map(int,input().split()):
        DP[i]=max(DP[i],DP[b]+A[i]-A[b])

print(DP[N])
0