結果
| 問題 | No.2923 Mayor's Job |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2024-06-15 17:13:12 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WJ
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 619 bytes |
| 記録 | |
| 最終ジャッジ日時 | 2026-08-28 06:36:54 |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
ソースコード
from collections import defaultdict N, K = map(int, input().split()) H = list(map(int, input().split())) points = defaultdict(list) for i in range(N): X, Y = map(int, input().split()) points[H[i]].append((X, Y)) existing = [] for h in sorted(points.keys()): reject = set() for X, Y in points[h]: for i, (x, y) in enumerate(existing): if (X - x)**2 + (Y - y)**2 <= K**2: reject.add(i) new_existing = [] for i, (X, Y) in enumerate(existing): if i not in reject: new_existing.append((X, Y)) for X, Y in points[h]: new_existing.append((X, Y)) existing = new_existing print(len(existing))