結果
| 問題 |
No.2923 Mayor's Job
|
| コンテスト | |
| ユーザー |
yamasaKit_
|
| 提出日時 | 2025-01-31 23:51:29 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,172 bytes |
| コンパイル時間 | 388 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 20,388 KB |
| 最終ジャッジ日時 | 2025-01-31 23:51:38 |
| 合計ジャッジ時間 | 8,923 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 TLE * 1 |
ソースコード
from collections import *
from itertools import *
from functools import cache, partial
from pprint import pprint
import sys
from typing import Any, Final
try:
from icecream import ic
except ImportError: # Graceful fallback if IceCream isn't installed.
ic = lambda *a: None if not a else (a[0] if len(a) == 1 else a) # noqa
debug = partial(print, file=sys.stderr)
dpprint = partial(pprint, stream=sys.stderr)
sys.setrecursionlimit(10**6)
MOD = 998244353
N, K = list(map(int, input().split()))
H_ = list(map(int, input().split()))
H = [(h, i) for i, h in enumerate(H_)]
H.sort()
# ic(H)
XY = []
for _ in range(N):
x, y = map(int, input().split())
XY.append((x, y))
destroied = [False] * N
for s, t in groupby(H, key=lambda x: x[0]):
T = set([x for _, x in t])
# ic(s, T)
for i in T:
xi, yi = XY[i]
for j, (x, y) in enumerate(XY):
if j in T:
continue
if destroied[j]:
continue
xj, yj = x, y
if (xi - xj) ** 2 + (yi - yj) ** 2 <= K**2:
destroied[i] = True
break
# ic(destroied)
ans = N - sum(destroied)
print(ans)
yamasaKit_