結果
問題 |
No.3067 +10 Seconds Clock
|
ユーザー |
![]() |
提出日時 | 2025-03-22 01:55:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 175 ms / 2,000 ms |
コード長 | 377 bytes |
コンパイル時間 | 434 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 113,320 KB |
最終ジャッジ日時 | 2025-03-22 01:55:22 |
合計ジャッジ時間 | 4,350 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge7 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
n,T=map(int,input().split()) t=list(map(int,input().split())) K=int(input()) x=list(map(int,input().split())) p=[0]*n for v in x: p[v-1]=1 ok=K+1 ng=-1 while ok-ng>1: m=(ok+ng)//2 now=T k=m for i in range(n-1): now-=t[i] if now<=0: break if k>0 and p[i+1]: now+=10 k-=1 if now>0: ok=m else: ng=m print(ok if 0<=ok<=K else -1)