結果

問題 No.1265 Balloon Survival
ユーザー titiatitia
提出日時 2020-10-23 22:48:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,375 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 84,600 KB
最終ジャッジ日時 2023-09-28 17:11:21
合計ジャッジ時間 17,627 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,724 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 16 ms
7,720 KB
testcase_03 AC 16 ms
7,880 KB
testcase_04 AC 16 ms
7,880 KB
testcase_05 AC 16 ms
7,852 KB
testcase_06 AC 15 ms
7,852 KB
testcase_07 AC 15 ms
7,808 KB
testcase_08 AC 16 ms
7,808 KB
testcase_09 AC 15 ms
7,720 KB
testcase_10 AC 16 ms
7,892 KB
testcase_11 AC 16 ms
7,808 KB
testcase_12 AC 15 ms
7,872 KB
testcase_13 AC 16 ms
7,884 KB
testcase_14 AC 115 ms
16,292 KB
testcase_15 AC 87 ms
13,844 KB
testcase_16 AC 41 ms
10,220 KB
testcase_17 AC 643 ms
47,792 KB
testcase_18 AC 52 ms
11,176 KB
testcase_19 AC 43 ms
10,344 KB
testcase_20 AC 121 ms
16,076 KB
testcase_21 AC 279 ms
26,856 KB
testcase_22 AC 173 ms
19,500 KB
testcase_23 AC 199 ms
20,484 KB
testcase_24 AC 1,363 ms
83,672 KB
testcase_25 AC 1,339 ms
84,472 KB
testcase_26 AC 1,375 ms
84,600 KB
testcase_27 AC 1,334 ms
84,496 KB
testcase_28 AC 1,363 ms
84,588 KB
testcase_29 AC 1,357 ms
84,512 KB
testcase_30 AC 1,364 ms
84,548 KB
testcase_31 AC 1,374 ms
84,356 KB
testcase_32 AC 1,329 ms
84,360 KB
testcase_33 AC 1,368 ms
84,456 KB
testcase_34 AC 16 ms
7,896 KB
testcase_35 AC 16 ms
7,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
F=[tuple(map(int,input().split())) for i in range(N)]

LIST=[]

for i in range(N):
    x,y=F[i]
    for j in range(i+1,N):
        z,w=F[j]

        LIST.append(((x-z)**2+(y-w)**2,i,j))

LIST.sort()
ANS=0
USE=[0]*N

for d,i,j in LIST:
    if USE[i]==1 or USE[j]==1:
        continue
    if i==0:
        ANS+=1
        USE[j]=1
    else:
        USE[i]=1
        USE[j]=1
        
print(ANS)

        
0