結果

問題 No.3067 +10 Seconds Clock
ユーザー PNJ
提出日時 2025-03-22 15:28:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 625 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 113,408 KB
最終ジャッジ日時 2025-03-22 15:28:36
合計ジャッジ時間 3,619 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

N, T = map(int, input().split())
t = list(map(int, input().split()))
K = int(input())
x = list(map(int, input().split()))
clock = [0 for _ in range(N)]
for xx in x:
  clock[xx - 1] += 1

now, c = T, 0
for i in range(N - 1):
  while now - t[i] <= 0:
    if c == 0:
      print(-1)
      exit()
    now += 10
    c -= 1
  now -= t[i]
  c += clock[i + 1]
print(sum(clock) - c)
0