結果

問題 No.1265 Balloon Survival
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 16:36:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,731 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 1,731 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 135,500 KB
最終ジャッジ日時 2023-09-03 21:40:37
合計ジャッジ時間 22,782 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,240 KB
testcase_01 AC 73 ms
71,336 KB
testcase_02 AC 74 ms
71,076 KB
testcase_03 AC 75 ms
71,316 KB
testcase_04 AC 76 ms
71,396 KB
testcase_05 AC 74 ms
71,356 KB
testcase_06 AC 76 ms
71,232 KB
testcase_07 AC 75 ms
71,236 KB
testcase_08 AC 74 ms
71,284 KB
testcase_09 AC 73 ms
71,400 KB
testcase_10 AC 74 ms
71,396 KB
testcase_11 AC 73 ms
71,368 KB
testcase_12 AC 75 ms
71,376 KB
testcase_13 AC 77 ms
71,284 KB
testcase_14 AC 210 ms
80,360 KB
testcase_15 AC 170 ms
79,112 KB
testcase_16 AC 110 ms
76,580 KB
testcase_17 AC 795 ms
102,504 KB
testcase_18 AC 127 ms
77,532 KB
testcase_19 AC 113 ms
76,580 KB
testcase_20 AC 203 ms
80,424 KB
testcase_21 AC 428 ms
94,368 KB
testcase_22 AC 249 ms
81,880 KB
testcase_23 AC 296 ms
92,788 KB
testcase_24 AC 1,687 ms
133,292 KB
testcase_25 AC 1,670 ms
134,216 KB
testcase_26 AC 1,673 ms
135,176 KB
testcase_27 AC 1,658 ms
134,160 KB
testcase_28 AC 1,702 ms
135,500 KB
testcase_29 AC 1,701 ms
135,184 KB
testcase_30 AC 1,731 ms
135,280 KB
testcase_31 AC 1,683 ms
134,564 KB
testcase_32 AC 1,696 ms
134,148 KB
testcase_33 AC 1,683 ms
134,128 KB
testcase_34 AC 75 ms
71,248 KB
testcase_35 AC 73 ms
71,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
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
used=[False]*n
for dst,i,j in a:
    if i==0:
        if not used[j]:
            ans+=1
            used[j]=True
    elif not used[j] and not used[i]:
        used[i]=used[j]=True
print(ans)
0