結果
問題 | No.1265 Balloon Survival |
ユーザー |
|
提出日時 | 2021-02-23 09:55:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 700 ms / 2,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 82,848 KB |
実行使用メモリ | 173,756 KB |
最終ジャッジ日時 | 2024-09-22 06:05:28 |
合計ジャッジ時間 | 9,547 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 32 |
ソースコード
from collections import defaultdictN=int(input())data=[]for _ in range(N):x,y=map(int, input().split())data.append((x,y))d=defaultdict(list)for i in range(N):for j in range(i+1,N):x0,y0=data[i]x1,y1=data[j]d[(x0-x1)**2+(y0-y1)**2].append((i,j))used=set()cnt=0for t in sorted(list(d.keys())):for i,j in d[t]:if i==0 and j not in used:used.add(j)cnt+=1if i not in used and j not in used:used.add(i)used.add(j)print(cnt)