結果
| 問題 | No.3468 あるジャッジサーバー |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-03-06 22:50:27 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 2,000 ms |
| コード長 | 442 bytes |
| 記録 | |
| コンパイル時間 | 291 ms |
| コンパイル使用メモリ | 85,404 KB |
| 実行使用メモリ | 65,968 KB |
| 最終ジャッジ日時 | 2026-03-06 22:50:36 |
| 合計ジャッジ時間 | 1,542 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 |
ソースコード
from heapq import heapify, heappop, heappush
N = int(input())
T = [int(s) for s in input().split()]
S = [int(s) for s in input().split()]
pq = [(s, i) for i, s in enumerate(S)]
heapify(pq)
ans = 0
is_proceed = False
while pq:
time, idx = heappop(pq)
if idx == -1:
is_proceed = False
continue
if not is_proceed:
is_proceed = True
heappush(pq, (time + T[idx], -1))
ans += 1
print(ans)