結果

問題 No.2923 Mayor's Job
ユーザー hato336
提出日時 2024-10-12 15:05:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 90,608 KB
最終ジャッジ日時 2024-10-12 15:05:51
合計ジャッジ時間 4,319 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
n,k = map(int,input().split())
h = list(map(int,input().split()))
#alist = []
a = []
for i in range(n):
    x,y = map(int,input().split())
    a.append([h[i],x,y])
a.sort()
ans = [1 for i in range(n)]
cnt = 0
for z,x,y in a:
    for j in range(cnt):
        if a[j][0] < z and (x-a[j][1])**2 + (y-a[j][2])**2 <= k**2:
            ans[j] = 0
    cnt += 1
print(sum(ans))
0