結果

問題 No.1265 Balloon Survival
ユーザー _matumo__matumo_
提出日時 2020-11-05 20:04:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,349 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 608 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 84,660 KB
最終ジャッジ日時 2023-09-29 17:32:53
合計ジャッジ時間 17,608 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 15 ms
7,776 KB
testcase_02 AC 16 ms
7,792 KB
testcase_03 AC 15 ms
7,776 KB
testcase_04 AC 15 ms
7,792 KB
testcase_05 AC 15 ms
7,820 KB
testcase_06 AC 16 ms
7,924 KB
testcase_07 AC 15 ms
7,812 KB
testcase_08 AC 15 ms
7,764 KB
testcase_09 AC 15 ms
7,816 KB
testcase_10 AC 16 ms
7,788 KB
testcase_11 AC 16 ms
7,952 KB
testcase_12 AC 16 ms
7,852 KB
testcase_13 AC 16 ms
7,828 KB
testcase_14 AC 120 ms
16,432 KB
testcase_15 AC 88 ms
13,992 KB
testcase_16 AC 42 ms
10,208 KB
testcase_17 AC 657 ms
47,844 KB
testcase_18 AC 56 ms
11,328 KB
testcase_19 AC 44 ms
10,496 KB
testcase_20 AC 124 ms
16,012 KB
testcase_21 AC 300 ms
26,920 KB
testcase_22 AC 181 ms
19,456 KB
testcase_23 AC 188 ms
20,540 KB
testcase_24 AC 1,339 ms
83,752 KB
testcase_25 AC 1,349 ms
84,564 KB
testcase_26 AC 1,334 ms
84,540 KB
testcase_27 AC 1,288 ms
84,404 KB
testcase_28 AC 1,303 ms
84,584 KB
testcase_29 AC 1,297 ms
84,624 KB
testcase_30 AC 1,298 ms
84,660 KB
testcase_31 AC 1,339 ms
84,528 KB
testcase_32 AC 1,344 ms
84,572 KB
testcase_33 AC 1,337 ms
84,448 KB
testcase_34 AC 16 ms
7,960 KB
testcase_35 AC 15 ms
7,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N =int(input())
pa=[[int(a) for a in input().split()] for i in range(N)]
pb=[]
for i,(xi,yi) in enumerate(pa[:-1]):
    for j in range(i+1,N):
        xj,yj=pa[j]
        r=(xi-xj)**2+(yi-yj)**2
        pb.append((r,i,j))
pb.sort()
pc=[0]*N
cn=0
for r,i,j in pb:
    if pc[i] or pc[j]: continue
    pc[j]=1
    if i>0: pc[i]=1
    else:   cn+=1
print(cn)
0