結果

問題 No.1265 Balloon Survival
ユーザー aqua_tenhouaqua_tenhou
提出日時 2020-10-23 22:19:07
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,460 ms / 2,000 ms
コード長 508 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 107,156 KB
最終ジャッジ日時 2023-09-28 16:11:59
合計ジャッジ時間 18,374 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,844 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 16 ms
7,820 KB
testcase_03 AC 16 ms
7,848 KB
testcase_04 AC 17 ms
7,832 KB
testcase_05 AC 16 ms
7,908 KB
testcase_06 AC 16 ms
7,864 KB
testcase_07 AC 15 ms
7,908 KB
testcase_08 AC 16 ms
7,816 KB
testcase_09 AC 16 ms
7,888 KB
testcase_10 AC 16 ms
7,992 KB
testcase_11 AC 16 ms
7,816 KB
testcase_12 AC 16 ms
7,864 KB
testcase_13 AC 16 ms
7,816 KB
testcase_14 AC 139 ms
18,924 KB
testcase_15 AC 100 ms
15,908 KB
testcase_16 AC 42 ms
10,880 KB
testcase_17 AC 689 ms
59,968 KB
testcase_18 AC 57 ms
12,456 KB
testcase_19 AC 45 ms
11,268 KB
testcase_20 AC 125 ms
19,020 KB
testcase_21 AC 314 ms
32,568 KB
testcase_22 AC 183 ms
23,100 KB
testcase_23 AC 207 ms
24,696 KB
testcase_24 AC 1,448 ms
105,508 KB
testcase_25 AC 1,447 ms
107,100 KB
testcase_26 AC 1,434 ms
107,036 KB
testcase_27 AC 1,423 ms
107,016 KB
testcase_28 AC 1,460 ms
107,036 KB
testcase_29 AC 1,433 ms
106,956 KB
testcase_30 AC 1,442 ms
107,156 KB
testcase_31 AC 1,440 ms
106,984 KB
testcase_32 AC 1,446 ms
106,960 KB
testcase_33 AC 1,432 ms
107,012 KB
testcase_34 AC 16 ms
7,860 KB
testcase_35 AC 16 ms
7,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
z = [list(map(int,input().split())) for _ in range(n)]

dis2 = []

for i in range(n):
    for j in range(i+1,n):
        d = (z[i][0] - z[j][0])**2 + (z[i][1] - z[j][1])**2
        dis2.append([i,j,d])
        
not_exist = set([])
dis2.sort(key= lambda val : val[2])
ans = 0

for i, j, dis in dis2:
    if i in not_exist or j in not_exist:
        pass
    elif i == 0:
        not_exist.add(j)
        ans += 1
    else:
        not_exist.add(i)
        not_exist.add(j)
        
print(ans)
0