結果

問題 No.1265 Balloon Survival
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-02-20 10:04:10
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,816 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 81,620 KB
実行使用メモリ 135,800 KB
最終ジャッジ日時 2023-10-17 14:03:40
合計ジャッジ時間 23,546 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,388 KB
testcase_01 AC 36 ms
53,388 KB
testcase_02 AC 36 ms
53,388 KB
testcase_03 AC 37 ms
53,388 KB
testcase_04 AC 36 ms
53,388 KB
testcase_05 AC 36 ms
53,392 KB
testcase_06 AC 36 ms
53,396 KB
testcase_07 AC 36 ms
53,396 KB
testcase_08 AC 36 ms
53,396 KB
testcase_09 AC 36 ms
53,396 KB
testcase_10 AC 37 ms
53,396 KB
testcase_11 AC 36 ms
53,396 KB
testcase_12 AC 37 ms
53,396 KB
testcase_13 AC 37 ms
53,396 KB
testcase_14 AC 192 ms
84,000 KB
testcase_15 AC 149 ms
81,576 KB
testcase_16 AC 76 ms
70,324 KB
testcase_17 AC 843 ms
110,828 KB
testcase_18 AC 102 ms
78,372 KB
testcase_19 AC 80 ms
72,524 KB
testcase_20 AC 194 ms
83,956 KB
testcase_21 AC 389 ms
95,308 KB
testcase_22 AC 245 ms
87,124 KB
testcase_23 AC 265 ms
88,708 KB
testcase_24 AC 1,743 ms
135,800 KB
testcase_25 AC 1,758 ms
135,800 KB
testcase_26 AC 1,752 ms
135,800 KB
testcase_27 AC 1,812 ms
135,796 KB
testcase_28 AC 1,753 ms
135,796 KB
testcase_29 AC 1,758 ms
135,800 KB
testcase_30 AC 1,748 ms
135,780 KB
testcase_31 AC 1,695 ms
135,800 KB
testcase_32 AC 1,816 ms
135,800 KB
testcase_33 AC 1,706 ms
135,800 KB
testcase_34 AC 37 ms
53,396 KB
testcase_35 AC 36 ms
53,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
ary=[]
for i in range(n):
  xi,yi=xy[i]
  for j in range(i):
    xj,yj=xy[j]
    d=(xi-xj)**2+(yi-yj)**2
    ary.append([d,i,j])
ary.sort()
ans=0
mi=set(range(n))
for d,i,j in ary:
  if i in mi and j in mi:
    if i!=0 and j!=0:
      mi.discard(i)
      mi.discard(j)
    else:
      ans+=1
      if j!=0:
        mi.discard(j)
      else:
        mi.discard(i)
print(ans)

0