結果

問題 No.3067 +10 Seconds Clock
ユーザー 回転
提出日時 2025-05-22 01:59:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 82,684 KB
実行使用メモリ 130,208 KB
最終ジャッジ日時 2025-05-22 01:59:54
合計ジャッジ時間 5,082 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

N,T = list(map(int,input().split()))
t = list(map(int,input().split()))
K = int(input())
x = set(map(lambda x:int(x)-1,input().split()))

def check(n):
    time = T
    get = 0
    for i in range(N-1):
        time -= t[i]
        if(time <= 0):return False
        if(i+1 in x and get < n):
            get += 1
            time += 10
    return True

ng,ok = -1,K+1
while(ok - ng > 1):
    mid = (ok+ng)//2
    if(check(mid)):
        ok = mid
    else:
        ng = mid
print(ok if ok != K+1 else -1)
0