結果

問題 No.1265 Balloon Survival
ユーザー titiatitia
提出日時 2020-10-23 22:49:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,115 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 91,376 KB
最終ジャッジ日時 2023-09-28 17:12:30
合計ジャッジ時間 14,468 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,944 KB
testcase_01 AC 17 ms
7,756 KB
testcase_02 AC 17 ms
7,800 KB
testcase_03 AC 17 ms
7,880 KB
testcase_04 AC 17 ms
7,880 KB
testcase_05 AC 17 ms
7,816 KB
testcase_06 AC 17 ms
7,928 KB
testcase_07 AC 18 ms
7,820 KB
testcase_08 AC 17 ms
7,756 KB
testcase_09 AC 17 ms
7,772 KB
testcase_10 AC 17 ms
7,872 KB
testcase_11 AC 17 ms
7,836 KB
testcase_12 AC 18 ms
7,816 KB
testcase_13 AC 17 ms
7,924 KB
testcase_14 AC 112 ms
17,052 KB
testcase_15 AC 83 ms
14,704 KB
testcase_16 AC 39 ms
10,316 KB
testcase_17 AC 540 ms
51,516 KB
testcase_18 AC 53 ms
11,676 KB
testcase_19 AC 43 ms
10,584 KB
testcase_20 AC 112 ms
17,164 KB
testcase_21 AC 244 ms
28,400 KB
testcase_22 AC 152 ms
20,768 KB
testcase_23 AC 163 ms
21,876 KB
testcase_24 AC 1,083 ms
89,756 KB
testcase_25 AC 1,083 ms
91,376 KB
testcase_26 AC 1,104 ms
91,288 KB
testcase_27 AC 1,089 ms
91,320 KB
testcase_28 AC 1,104 ms
91,296 KB
testcase_29 AC 1,108 ms
91,364 KB
testcase_30 AC 1,115 ms
91,292 KB
testcase_31 AC 1,094 ms
91,232 KB
testcase_32 AC 1,077 ms
91,224 KB
testcase_33 AC 1,085 ms
91,228 KB
testcase_34 AC 17 ms
8,364 KB
testcase_35 AC 17 ms
7,796 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))

from operator import itemgetter
LIST.sort(key=itemgetter(0))
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