結果

問題 No.1265 Balloon Survival
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-02-20 10:10:15
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,961 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 81,628 KB
実行使用メモリ 135,760 KB
最終ジャッジ日時 2023-10-17 14:09:30
合計ジャッジ時間 24,308 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,360 KB
testcase_01 AC 38 ms
53,360 KB
testcase_02 AC 37 ms
53,360 KB
testcase_03 AC 38 ms
53,360 KB
testcase_04 AC 38 ms
53,360 KB
testcase_05 AC 39 ms
53,360 KB
testcase_06 AC 38 ms
53,360 KB
testcase_07 AC 38 ms
53,360 KB
testcase_08 AC 38 ms
53,360 KB
testcase_09 AC 38 ms
53,360 KB
testcase_10 AC 37 ms
53,360 KB
testcase_11 AC 38 ms
53,360 KB
testcase_12 AC 39 ms
53,360 KB
testcase_13 AC 38 ms
53,360 KB
testcase_14 AC 204 ms
83,920 KB
testcase_15 AC 156 ms
81,492 KB
testcase_16 AC 78 ms
70,228 KB
testcase_17 AC 929 ms
110,776 KB
testcase_18 AC 106 ms
78,272 KB
testcase_19 AC 83 ms
72,428 KB
testcase_20 AC 199 ms
83,924 KB
testcase_21 AC 423 ms
95,276 KB
testcase_22 AC 261 ms
87,092 KB
testcase_23 AC 291 ms
88,676 KB
testcase_24 AC 1,926 ms
135,748 KB
testcase_25 AC 1,911 ms
135,752 KB
testcase_26 AC 1,910 ms
135,752 KB
testcase_27 AC 1,910 ms
135,752 KB
testcase_28 AC 1,935 ms
135,752 KB
testcase_29 AC 1,961 ms
135,752 KB
testcase_30 AC 1,956 ms
135,752 KB
testcase_31 AC 1,894 ms
135,756 KB
testcase_32 AC 1,918 ms
135,760 KB
testcase_33 AC 1,896 ms
135,756 KB
testcase_34 AC 39 ms
53,360 KB
testcase_35 AC 37 ms
53,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
ary=[]
#mat=[[0]*n for i in range(n)]
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
    #mat[i][j]=d
    #mat[j][i]=d
    ary.append([d,i,j])
ary.sort()
ans=0
seen=[0]*n
for d,i,j in ary:
  if seen[i]==0 and seen[j]==0:
    seen[i]=1
    seen[j]=1
    if i==0 or j==0:
      ans+=1
      seen[0]=0

print(ans)

0