結果
| 問題 | No.2923 Mayor's Job | 
| コンテスト | |
| ユーザー |  timi | 
| 提出日時 | 2024-10-12 15:07:30 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 578 bytes | 
| コンパイル時間 | 195 ms | 
| コンパイル使用メモリ | 82,284 KB | 
| 実行使用メモリ | 422,240 KB | 
| 最終ジャッジ日時 | 2024-10-12 15:07:40 | 
| 合計ジャッジ時間 | 4,011 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 1 TLE * 1 -- * 15 | 
ソースコード
import heapq 
from heapq import heappop,heappush,heapify
from sys import stdin, setrecursionlimit
input = stdin.readline
readline = stdin.readline
from collections import deque
d=deque()
#T=int(input())
N,K=map(int,input().split())
H=list(map(int, input().split()))
A=[]
C=[[0]*N for i in range(N)]
for i in range(N):
  x,y=map(int,input().split())
  A.append((x,y))
  
D=[]
for i in range(N):
  for j in range(N):
    x,y=A[i];p,q=A[j]
    if H[i]<H[j] and (x-p)**2+(y-q)**2<=K**2:
      D.append((H[j],j,i))
D=sorted(D)
ans=[1]*N 
for _,_,x in D:
  ans[x]=0 
print(sum(ans))
            
            
            
        