結果

問題 No.1676 Coin Trade (Single)
ユーザー titiatitia
提出日時 2021-09-10 23:03:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 88,556 KB
最終ジャッジ日時 2023-09-02 20:56:08
合計ジャッジ時間 6,318 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,060 KB
testcase_01 AC 72 ms
71,312 KB
testcase_02 AC 73 ms
71,236 KB
testcase_03 AC 230 ms
84,740 KB
testcase_04 AC 147 ms
84,572 KB
testcase_05 AC 138 ms
82,676 KB
testcase_06 AC 145 ms
84,008 KB
testcase_07 AC 133 ms
82,624 KB
testcase_08 AC 108 ms
78,312 KB
testcase_09 AC 131 ms
82,108 KB
testcase_10 AC 138 ms
82,060 KB
testcase_11 AC 157 ms
85,956 KB
testcase_12 AC 120 ms
80,256 KB
testcase_13 AC 72 ms
71,256 KB
testcase_14 AC 73 ms
71,328 KB
testcase_15 AC 73 ms
70,948 KB
testcase_16 AC 72 ms
71,072 KB
testcase_17 AC 70 ms
71,256 KB
testcase_18 AC 73 ms
71,336 KB
testcase_19 AC 72 ms
71,296 KB
testcase_20 AC 71 ms
71,120 KB
testcase_21 AC 72 ms
71,296 KB
testcase_22 AC 71 ms
71,148 KB
testcase_23 AC 71 ms
71,176 KB
testcase_24 AC 71 ms
71,244 KB
testcase_25 AC 70 ms
71,308 KB
testcase_26 AC 72 ms
71,244 KB
testcase_27 AC 72 ms
71,196 KB
testcase_28 AC 72 ms
70,944 KB
testcase_29 AC 71 ms
71,272 KB
testcase_30 AC 71 ms
71,216 KB
testcase_31 AC 71 ms
71,224 KB
testcase_32 AC 71 ms
71,060 KB
testcase_33 AC 170 ms
88,448 KB
testcase_34 AC 170 ms
88,556 KB
testcase_35 AC 171 ms
88,424 KB
testcase_36 AC 173 ms
88,468 KB
testcase_37 AC 170 ms
88,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

V=[0]*N
C=[[] for i in range(N)]

for i in range(N):
    A,M=map(int,input().split())
    V[i]=A
    C[i]=list(map(int,input().split()))


DP=[0]*N


for i in range(N):
    v=V[i]

    MIN=1<<50

    DP[i]=max(DP[i],DP[i-1])

    for c in C[i]:
        c-=1
        DP[i]=max(DP[i],DP[c]+(v-V[c]))

print(max(DP))
        
0