結果

問題 No.3067 +10 Seconds Clock
コンテスト
ユーザー tkykwtnb
提出日時 2025-04-04 23:37:07
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 421 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 495 ms
コンパイル使用メモリ 95,848 KB
実行使用メモリ 1,342,556 KB
最終ジャッジ日時 2026-07-08 11:28:24
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 WA * 1 MLE * 2 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N,T=map(int,input().split())
t=list(map(int,input().split()))
K=int(input())
x=set(map(int,input().split()))
dp=[[] for _ in range(N)]
dp[0]=[(0,T)]
for i in range(N-1):
    for cnt,rest in dp[i]:
        if rest-t[i]>0:
            dp[i+1].append((cnt,rest-t[i]))
            if i in x:
                dp[i+1].append((cnt+1,rest-t[i]+10))
if len(dp[N-1]):
    dp[N-1].sort()
    print(dp[N-1][0][0])
else:
    print(-1)
0