結果

問題 No.3067 +10 Seconds Clock
ユーザー Kude
提出日時 2025-03-21 21:31:24
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 83 ms / 2,000 ms
+ 125µs
コード長 403 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 100 ms
コンパイル使用メモリ 64,332 KB
実行使用メモリ 93,104 KB
最終ジャッジ日時 2026-11-11 04:35:20
合計ジャッジ時間 4,076 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge7_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, t = map(int, input().split())
a = list(map(int, input().split()))
itm = [0] * n
input()
for x in map(int, input().split()):
    itm[x - 1] = 1
now = 0
ans = 0
for i in range(n - 1):
    # 10*use+t > ti
    # use>(ti-t)/10
    now += itm[i]
    use = max(0, (a[i] - t) // 10 + 1)
    if use > now:
        ans = -1
        break
    ans += use
    now -= use
    t += 10 * use
    t -= a[i]
print(ans)
0