結果

問題 No.3067 +10 Seconds Clock
ユーザー ルク
提出日時 2025-03-21 21:43:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 113,280 KB
最終ジャッジ日時 2025-03-21 21:43:33
合計ジャッジ時間 3,164 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

n, t = map(int, input().split())
a = list(map(int, input().split()))
k = int(input())
x = list(map(int, input().split()))
x.reverse()
cnt = 0
for i in range(n-1):
    t -= a[i]
    if t <= 0 and cnt < -((t-1)//10):
        exit(print(-1))
    if t <= 0:
        l = -((t-1)//10)
        cnt -= l
        t += l*10
    if x and x[-1] == i+2:
        cnt += 1
        x.pop()
print(k - cnt)
0