結果

問題 No.3067 +10 Seconds Clock
ユーザー nikoro256
提出日時 2025-03-21 21:49:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 137,500 KB
最終ジャッジ日時 2025-03-21 21:49:16
合計ジャッジ時間 4,325 ms
ジャッジサーバーID
(参考情報)
judge6 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N,T=map(int,input().split())
t=list(map(int,input().split()))
K=int(input())
X=list(map(int,input().split()))
X=set(X)

def binary_search(f):
    left,right=-1,10**6
    if f(left):
        return 0
    if not f(right):
        return -1
    while right-left>1:
        mid=(right+left)//2
        if f(mid):
            right=mid
        else:
            left=mid
    return right

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

print(binary_search(f))   
0