結果

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

ソースコード

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