結果

問題 No.1265 Balloon Survival
ユーザー 👑 timitimi
提出日時 2020-12-18 15:10:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,556 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 81,680 KB
実行使用メモリ 136,540 KB
最終ジャッジ日時 2023-10-21 08:08:03
合計ジャッジ時間 18,666 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,476 KB
testcase_01 AC 38 ms
53,476 KB
testcase_02 AC 34 ms
53,476 KB
testcase_03 AC 33 ms
53,476 KB
testcase_04 AC 36 ms
53,476 KB
testcase_05 AC 37 ms
53,476 KB
testcase_06 AC 37 ms
53,476 KB
testcase_07 AC 37 ms
53,476 KB
testcase_08 AC 35 ms
53,476 KB
testcase_09 AC 38 ms
53,476 KB
testcase_10 AC 34 ms
53,476 KB
testcase_11 AC 36 ms
53,476 KB
testcase_12 AC 34 ms
53,476 KB
testcase_13 AC 34 ms
53,476 KB
testcase_14 AC 156 ms
74,484 KB
testcase_15 AC 129 ms
70,876 KB
testcase_16 AC 68 ms
64,172 KB
testcase_17 AC 688 ms
104,048 KB
testcase_18 AC 85 ms
67,308 KB
testcase_19 AC 74 ms
64,472 KB
testcase_20 AC 161 ms
74,472 KB
testcase_21 AC 365 ms
96,636 KB
testcase_22 AC 202 ms
78,272 KB
testcase_23 AC 216 ms
79,092 KB
testcase_24 AC 1,445 ms
135,564 KB
testcase_25 AC 1,556 ms
136,540 KB
testcase_26 AC 1,446 ms
136,508 KB
testcase_27 AC 1,464 ms
136,528 KB
testcase_28 AC 1,481 ms
136,508 KB
testcase_29 AC 1,473 ms
136,540 KB
testcase_30 AC 1,466 ms
136,492 KB
testcase_31 AC 1,435 ms
136,528 KB
testcase_32 AC 1,495 ms
136,536 KB
testcase_33 AC 1,464 ms
136,508 KB
testcase_34 AC 36 ms
53,476 KB
testcase_35 AC 33 ms
53,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
N=int(input())
A=[]
for i in range(N):
  x,y=map(int, input().split())
  A.append((x,y,i))
B=[]
for i in range(N-1):
  for j in range(i+1,N):
    ax,ay,an=A[i][0],A[i][1],A[i][2]
    bx,by,bn=A[j][0],A[j][1],A[j][2]
    d=(ax-bx)**2+(ay-by)**2
    B.append((d,an,bn))
B=sorted(B)
ans=0
D=[1]*N
for i in range(len(B)):
  na,nb=B[i][1],B[i][2]
  if D[na]==1 and D[nb]==1:
    if na==0:
      ans+=1
      D[nb]=0
    else:
      D[na]=0
      D[nb]=0
print(ans)
0