結果

問題 No.1265 Balloon Survival
ユーザー ryu19ryu19
提出日時 2020-10-23 22:22:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,465 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 84,612 KB
最終ジャッジ日時 2023-09-28 16:17:20
合計ジャッジ時間 18,032 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,876 KB
testcase_01 AC 16 ms
7,792 KB
testcase_02 AC 16 ms
7,852 KB
testcase_03 AC 16 ms
7,844 KB
testcase_04 AC 17 ms
7,780 KB
testcase_05 AC 17 ms
7,864 KB
testcase_06 AC 17 ms
7,812 KB
testcase_07 AC 16 ms
7,820 KB
testcase_08 AC 17 ms
8,004 KB
testcase_09 AC 16 ms
7,820 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 AC 16 ms
7,868 KB
testcase_12 AC 17 ms
7,812 KB
testcase_13 AC 16 ms
7,816 KB
testcase_14 AC 141 ms
16,476 KB
testcase_15 AC 102 ms
13,988 KB
testcase_16 AC 44 ms
10,192 KB
testcase_17 AC 730 ms
47,892 KB
testcase_18 AC 62 ms
11,132 KB
testcase_19 AC 48 ms
10,324 KB
testcase_20 AC 143 ms
16,212 KB
testcase_21 AC 327 ms
26,844 KB
testcase_22 AC 191 ms
19,568 KB
testcase_23 AC 209 ms
20,620 KB
testcase_24 AC 1,465 ms
83,728 KB
testcase_25 AC 1,422 ms
84,384 KB
testcase_26 AC 1,397 ms
84,532 KB
testcase_27 AC 1,406 ms
84,384 KB
testcase_28 AC 1,396 ms
84,608 KB
testcase_29 AC 1,399 ms
84,612 KB
testcase_30 AC 1,431 ms
84,448 KB
testcase_31 AC 1,434 ms
84,440 KB
testcase_32 AC 1,376 ms
84,484 KB
testcase_33 AC 1,378 ms
84,488 KB
testcase_34 AC 16 ms
7,828 KB
testcase_35 AC 16 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = [None] * N
y = [None] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())

INF = 10 ** 12
burst = []
for i in range(N):
    for j in range(i + 1, N):
        res = (x[j] - x[i]) ** 2 + (y[j] - y[i]) ** 2
        burst.append((res, i, j))
burst.sort()

baloon = set()
cnt = 0
for b, i, j in burst:
    if i in baloon or j in baloon:
        continue
    if i == 0:
        cnt += 1
        baloon.add(j)
        continue
    else:
        baloon.add(i)
        baloon.add(j)
print(cnt)
0