結果

問題 No.3067 +10 Seconds Clock
ユーザー PNJ
提出日時 2025-03-22 15:28:32
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 86 ms / 2,000 ms
+ 575µs
コード長 374 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 281 ms
コンパイル使用メモリ 64,384 KB
実行使用メモリ 92,984 KB
最終ジャッジ日時 2026-11-11 04:54:32
合計ジャッジ時間 4,402 ms
ジャッジサーバーID
(参考情報)
judge7_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

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()))
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