結果

問題 No.1676 Coin Trade (Single)
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-12-09 22:40:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 1,271 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 83,612 KB
最終ジャッジ日時 2023-09-24 14:49:59
合計ジャッジ時間 9,058 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,068 KB
testcase_01 AC 73 ms
71,216 KB
testcase_02 AC 72 ms
71,224 KB
testcase_03 AC 209 ms
82,100 KB
testcase_04 AC 192 ms
80,812 KB
testcase_05 AC 186 ms
80,680 KB
testcase_06 AC 190 ms
80,504 KB
testcase_07 AC 175 ms
80,056 KB
testcase_08 AC 160 ms
78,960 KB
testcase_09 AC 172 ms
79,676 KB
testcase_10 AC 176 ms
80,260 KB
testcase_11 AC 207 ms
81,936 KB
testcase_12 AC 161 ms
79,416 KB
testcase_13 AC 73 ms
71,296 KB
testcase_14 AC 73 ms
71,068 KB
testcase_15 AC 73 ms
71,120 KB
testcase_16 AC 72 ms
70,956 KB
testcase_17 AC 72 ms
71,172 KB
testcase_18 AC 73 ms
71,188 KB
testcase_19 AC 72 ms
71,260 KB
testcase_20 AC 71 ms
71,440 KB
testcase_21 AC 74 ms
71,256 KB
testcase_22 AC 73 ms
70,936 KB
testcase_23 AC 71 ms
71,084 KB
testcase_24 AC 73 ms
71,352 KB
testcase_25 AC 74 ms
71,268 KB
testcase_26 AC 74 ms
71,308 KB
testcase_27 AC 74 ms
71,348 KB
testcase_28 AC 72 ms
71,084 KB
testcase_29 AC 72 ms
71,256 KB
testcase_30 AC 73 ms
71,124 KB
testcase_31 AC 72 ms
71,264 KB
testcase_32 AC 72 ms
71,212 KB
testcase_33 AC 236 ms
83,520 KB
testcase_34 AC 232 ms
83,540 KB
testcase_35 AC 239 ms
83,612 KB
testcase_36 AC 234 ms
83,484 KB
testcase_37 AC 233 ms
83,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
ans = 0
dp = [0]
for i in range(n):
    a,m = map(int,input().split())
    dp.append(ans-a)
    B = list(map(int,input().split()))
    for b in B:
        dp[-1] = max(dp[-1],dp[b])
    ans = max(ans,dp[-1]+a)
print(ans)
0