結果
| 問題 | No.3468 あるジャッジサーバー |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-03-06 22:50:27 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 2,000 ms |
| + 397µs | |
| コード長 | 442 bytes |
| 記録 | |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 95,976 KB |
| 実行使用メモリ | 83,200 KB |
| 最終ジャッジ日時 | 2026-07-27 07:11:27 |
| 合計ジャッジ時間 | 2,606 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)