結果

問題 No.1265 Balloon Survival
ユーザー tyawanmusityawanmusi
提出日時 2020-10-23 22:50:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,920 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 155,128 KB
最終ジャッジ日時 2023-09-28 17:17:16
合計ジャッジ時間 24,978 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,096 KB
testcase_01 AC 78 ms
71,556 KB
testcase_02 AC 79 ms
71,576 KB
testcase_03 AC 80 ms
71,248 KB
testcase_04 AC 78 ms
71,096 KB
testcase_05 AC 78 ms
71,512 KB
testcase_06 AC 79 ms
71,420 KB
testcase_07 AC 77 ms
71,372 KB
testcase_08 AC 77 ms
71,312 KB
testcase_09 AC 77 ms
71,264 KB
testcase_10 AC 78 ms
71,308 KB
testcase_11 AC 79 ms
71,576 KB
testcase_12 AC 78 ms
71,468 KB
testcase_13 AC 78 ms
71,368 KB
testcase_14 AC 218 ms
80,196 KB
testcase_15 AC 180 ms
78,652 KB
testcase_16 AC 112 ms
76,500 KB
testcase_17 AC 846 ms
102,368 KB
testcase_18 AC 135 ms
77,388 KB
testcase_19 AC 121 ms
76,612 KB
testcase_20 AC 217 ms
80,188 KB
testcase_21 AC 456 ms
93,016 KB
testcase_22 AC 264 ms
81,892 KB
testcase_23 AC 314 ms
92,892 KB
testcase_24 AC 1,896 ms
153,568 KB
testcase_25 AC 1,873 ms
154,384 KB
testcase_26 AC 1,857 ms
155,052 KB
testcase_27 AC 1,889 ms
154,528 KB
testcase_28 AC 1,878 ms
155,124 KB
testcase_29 AC 1,920 ms
155,076 KB
testcase_30 AC 1,880 ms
155,128 KB
testcase_31 AC 1,871 ms
154,480 KB
testcase_32 AC 1,861 ms
154,632 KB
testcase_33 AC 1,824 ms
154,480 KB
testcase_34 AC 79 ms
71,308 KB
testcase_35 AC 77 ms
71,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
xy=[list(map(int,input().split()))for _ in range(n)]
e=[]
for i in range(n-1):
  for j in range(i+1,n):
    x1,y1=xy[i]
    x2,y2=xy[j]
    e.append(((x1-x2)**2+(y1-y2)**2,i,j))
e.sort()
used=[0]*n
ans=0
for _,i,j in e:
  if used[i]+used[j]:
    continue
  if i==0:
    used[j]=1
    ans+=1
  else:
    used[i]=used[j]=1
print(ans)
0