結果

問題 No.1265 Balloon Survival
ユーザー MineMine
提出日時 2020-12-03 23:38:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,774 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 116,092 KB
最終ジャッジ日時 2023-10-12 10:09:08
合計ジャッジ時間 21,876 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,784 KB
testcase_01 AC 15 ms
7,856 KB
testcase_02 AC 15 ms
7,920 KB
testcase_03 AC 15 ms
7,788 KB
testcase_04 AC 16 ms
7,784 KB
testcase_05 AC 17 ms
7,828 KB
testcase_06 AC 16 ms
7,784 KB
testcase_07 AC 16 ms
7,916 KB
testcase_08 AC 16 ms
7,780 KB
testcase_09 AC 15 ms
7,856 KB
testcase_10 AC 15 ms
7,824 KB
testcase_11 AC 16 ms
7,800 KB
testcase_12 AC 16 ms
7,916 KB
testcase_13 AC 15 ms
7,808 KB
testcase_14 AC 159 ms
20,156 KB
testcase_15 AC 114 ms
16,924 KB
testcase_16 AC 48 ms
11,280 KB
testcase_17 AC 828 ms
64,564 KB
testcase_18 AC 66 ms
12,732 KB
testcase_19 AC 53 ms
11,656 KB
testcase_20 AC 151 ms
19,836 KB
testcase_21 AC 364 ms
35,076 KB
testcase_22 AC 212 ms
24,432 KB
testcase_23 AC 228 ms
26,176 KB
testcase_24 AC 1,709 ms
115,120 KB
testcase_25 AC 1,739 ms
115,892 KB
testcase_26 AC 1,710 ms
116,072 KB
testcase_27 AC 1,774 ms
115,772 KB
testcase_28 AC 1,719 ms
116,092 KB
testcase_29 AC 1,735 ms
116,040 KB
testcase_30 AC 1,733 ms
116,064 KB
testcase_31 AC 1,748 ms
115,852 KB
testcase_32 AC 1,753 ms
115,972 KB
testcase_33 AC 1,748 ms
115,864 KB
testcase_34 AC 16 ms
7,964 KB
testcase_35 AC 15 ms
7,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def distance(X, Y):
    return abs(X[0] - Y[0])**2 + abs(X[1] - Y[1])**2

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

for i in range(n):
    for g in range(i+1, n):
        d.append((distance(xy[i], xy[g]), (i, g)))
d.sort()

delete = set()
exploded = set()
cnt = 0
used = [False]*n

for i, x in d:
    if (x[0] in delete) or (x[1] in delete) or (x[0] in exploded) or (x[1] in exploded):
        continue
    if x[0] == 0:
        delete.add(x[1])
    else:
        exploded.add(x[0])
        exploded.add(x[1])
print(len(delete))


0