結果

問題 No.1265 Balloon Survival
ユーザー NoneNone
提出日時 2021-02-23 09:55:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 678 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 630 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 172,948 KB
最終ジャッジ日時 2023-10-22 04:47:20
合計ジャッジ時間 10,164 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
55,608 KB
testcase_01 AC 41 ms
55,608 KB
testcase_02 AC 40 ms
53,560 KB
testcase_03 AC 39 ms
55,608 KB
testcase_04 AC 38 ms
55,608 KB
testcase_05 AC 40 ms
55,608 KB
testcase_06 AC 40 ms
55,608 KB
testcase_07 AC 39 ms
55,608 KB
testcase_08 AC 44 ms
55,608 KB
testcase_09 AC 40 ms
55,608 KB
testcase_10 AC 40 ms
55,608 KB
testcase_11 AC 41 ms
55,608 KB
testcase_12 AC 40 ms
55,608 KB
testcase_13 AC 39 ms
55,608 KB
testcase_14 AC 111 ms
93,720 KB
testcase_15 AC 78 ms
80,072 KB
testcase_16 AC 59 ms
70,088 KB
testcase_17 AC 308 ms
142,580 KB
testcase_18 AC 65 ms
74,128 KB
testcase_19 AC 60 ms
70,692 KB
testcase_20 AC 106 ms
93,456 KB
testcase_21 AC 159 ms
98,316 KB
testcase_22 AC 128 ms
98,472 KB
testcase_23 AC 133 ms
98,944 KB
testcase_24 AC 550 ms
172,948 KB
testcase_25 AC 551 ms
172,912 KB
testcase_26 AC 638 ms
172,940 KB
testcase_27 AC 535 ms
172,948 KB
testcase_28 AC 532 ms
172,868 KB
testcase_29 AC 678 ms
172,944 KB
testcase_30 AC 557 ms
172,940 KB
testcase_31 AC 572 ms
172,940 KB
testcase_32 AC 676 ms
172,940 KB
testcase_33 AC 557 ms
172,944 KB
testcase_34 AC 41 ms
55,608 KB
testcase_35 AC 40 ms
55,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N=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=0
for t in sorted(list(d.keys())):
    for i,j in d[t]:
        if i==0 and j not in used:
            used.add(j)
            cnt+=1
        if i not in used and j not in used:
            used.add(i)
            used.add(j)
print(cnt)
0