結果

問題 No.1265 Balloon Survival
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 16:28:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,612 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 86,804 KB
実行使用メモリ 155,244 KB
最終ジャッジ日時 2023-09-03 21:19:59
合計ジャッジ時間 21,003 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,396 KB
testcase_01 AC 69 ms
71,168 KB
testcase_02 AC 67 ms
71,120 KB
testcase_03 AC 69 ms
71,436 KB
testcase_04 AC 70 ms
71,464 KB
testcase_05 AC 72 ms
71,168 KB
testcase_06 AC 68 ms
71,168 KB
testcase_07 AC 69 ms
70,996 KB
testcase_08 AC 69 ms
71,168 KB
testcase_09 AC 68 ms
71,180 KB
testcase_10 AC 69 ms
71,436 KB
testcase_11 AC 68 ms
71,096 KB
testcase_12 AC 69 ms
71,000 KB
testcase_13 AC 69 ms
71,064 KB
testcase_14 AC 192 ms
80,228 KB
testcase_15 AC 158 ms
78,716 KB
testcase_16 AC 104 ms
76,256 KB
testcase_17 AC 737 ms
102,144 KB
testcase_18 AC 119 ms
77,452 KB
testcase_19 AC 107 ms
76,648 KB
testcase_20 AC 190 ms
80,212 KB
testcase_21 AC 376 ms
92,032 KB
testcase_22 AC 254 ms
91,316 KB
testcase_23 AC 272 ms
92,600 KB
testcase_24 AC 1,586 ms
153,656 KB
testcase_25 AC 1,588 ms
154,596 KB
testcase_26 AC 1,611 ms
154,896 KB
testcase_27 AC 1,612 ms
154,380 KB
testcase_28 AC 1,582 ms
155,244 KB
testcase_29 AC 1,594 ms
155,132 KB
testcase_30 AC 1,557 ms
155,236 KB
testcase_31 AC 1,555 ms
154,636 KB
testcase_32 AC 1,563 ms
154,888 KB
testcase_33 AC 1,578 ms
154,512 KB
testcase_34 AC 68 ms
70,996 KB
testcase_35 AC 68 ms
71,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
p=[tuple(map(int,input().split())) for _ in range(n)]
a=[]
for i in range(n):
    for j in range(i+1,n):
        d=(p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2
        a.append((d,i,j))
a.sort()
ans=0
t=set()
for dst,i,j in a:
    if i in t or j in t:
        continue
    if i==0:
        ans+=1
        t.add(j)
    else:
        t.add(i)
        t.add(j)
print(ans)
0