結果

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

ソースコード

diff #
raw source code

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

items = 0
ans = 0
j = 0
for i in range(N-1):
  T -= t[i]
  
  while T <= 0 and items:
    T += 10
    items -= 1
    ans += 1
    
  if T <= 0:
    ans = -1
    break
  
  if j < K and x[j] == i+2:
    j += 1
    items += 1
  
print(ans)
0