結果

問題 No.3067 +10 Seconds Clock
コンテスト
ユーザー titia
提出日時 2025-03-21 21:33:30
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 198 ms / 2,000 ms
+ 893µs
コード長 375 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 55 ms
コンパイル使用メモリ 14,848 KB
実行使用メモリ 43,572 KB
最終ジャッジ日時 2026-10-21 07:07:34
合計ジャッジ時間 4,844 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

N,T=map(int,input().split())
TL=list(map(int,input().split()))

K=int(input())
X=set(map(int,input().split()))

canuse=0
ANS=0



for i in range(N-1):
    T-=TL[i]

    while T<=0 and canuse>0:
        T+=10
        canuse-=1
        ANS+=1

    if T<=0:
        print(-1)
        exit()

    if i+2 in X:
        canuse+=1

print(ANS)
0