結果

問題 No.1676 Coin Trade (Single)
ユーザー shinichishinichi
提出日時 2021-09-11 16:53:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 310 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 1,116 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 87,844 KB
最終ジャッジ日時 2023-09-05 04:30:58
合計ジャッジ時間 10,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,072 KB
testcase_01 AC 74 ms
71,280 KB
testcase_02 AC 73 ms
71,356 KB
testcase_03 AC 264 ms
84,388 KB
testcase_04 AC 217 ms
81,908 KB
testcase_05 AC 207 ms
82,164 KB
testcase_06 AC 213 ms
83,088 KB
testcase_07 AC 190 ms
81,128 KB
testcase_08 AC 160 ms
79,096 KB
testcase_09 AC 198 ms
80,696 KB
testcase_10 AC 198 ms
81,036 KB
testcase_11 AC 261 ms
84,224 KB
testcase_12 AC 177 ms
79,408 KB
testcase_13 AC 74 ms
71,172 KB
testcase_14 AC 72 ms
71,232 KB
testcase_15 AC 73 ms
71,196 KB
testcase_16 AC 74 ms
71,008 KB
testcase_17 AC 75 ms
70,828 KB
testcase_18 AC 75 ms
71,020 KB
testcase_19 AC 75 ms
71,008 KB
testcase_20 AC 74 ms
71,240 KB
testcase_21 AC 75 ms
71,088 KB
testcase_22 AC 76 ms
71,188 KB
testcase_23 AC 75 ms
71,076 KB
testcase_24 AC 73 ms
71,264 KB
testcase_25 AC 75 ms
71,232 KB
testcase_26 AC 74 ms
71,060 KB
testcase_27 AC 76 ms
71,080 KB
testcase_28 AC 74 ms
70,972 KB
testcase_29 AC 74 ms
71,024 KB
testcase_30 AC 74 ms
71,264 KB
testcase_31 AC 74 ms
71,236 KB
testcase_32 AC 75 ms
71,216 KB
testcase_33 AC 275 ms
86,672 KB
testcase_34 AC 310 ms
87,844 KB
testcase_35 AC 295 ms
85,768 KB
testcase_36 AC 295 ms
85,816 KB
testcase_37 AC 295 ms
86,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [0] * (N+1)
data = []
for i in range(N):
    a, m = map(int, input().split())
    data.append((a, m))
    B = list(map(lambda x:int(x)-1, input().split()))
    if i:
        dp[i] = dp[i-1]
    for b in B:
        aa, mm = data[b]
        dp[i] = max(dp[i], dp[b]+a-aa)
print(max(dp))
0