結果

問題 No.1265 Balloon Survival
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 16:28:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,772 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 155,032 KB
最終ジャッジ日時 2023-09-03 21:21:55
合計ジャッジ時間 23,541 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,212 KB
testcase_01 AC 74 ms
71,280 KB
testcase_02 AC 75 ms
70,868 KB
testcase_03 AC 73 ms
71,124 KB
testcase_04 AC 73 ms
71,288 KB
testcase_05 AC 74 ms
71,024 KB
testcase_06 AC 73 ms
70,872 KB
testcase_07 AC 73 ms
70,868 KB
testcase_08 AC 73 ms
71,148 KB
testcase_09 AC 72 ms
71,136 KB
testcase_10 AC 73 ms
71,292 KB
testcase_11 AC 73 ms
70,868 KB
testcase_12 AC 74 ms
71,288 KB
testcase_13 AC 74 ms
70,872 KB
testcase_14 AC 213 ms
80,156 KB
testcase_15 AC 172 ms
78,732 KB
testcase_16 AC 110 ms
76,128 KB
testcase_17 AC 794 ms
101,944 KB
testcase_18 AC 131 ms
77,204 KB
testcase_19 AC 118 ms
76,260 KB
testcase_20 AC 210 ms
80,088 KB
testcase_21 AC 421 ms
91,720 KB
testcase_22 AC 286 ms
90,892 KB
testcase_23 AC 300 ms
92,408 KB
testcase_24 AC 1,769 ms
153,672 KB
testcase_25 AC 1,754 ms
154,488 KB
testcase_26 AC 1,759 ms
155,020 KB
testcase_27 AC 1,755 ms
154,648 KB
testcase_28 AC 1,740 ms
154,800 KB
testcase_29 AC 1,759 ms
154,896 KB
testcase_30 AC 1,743 ms
155,032 KB
testcase_31 AC 1,742 ms
154,372 KB
testcase_32 AC 1,772 ms
154,636 KB
testcase_33 AC 1,727 ms
154,520 KB
testcase_34 AC 76 ms
71,112 KB
testcase_35 AC 74 ms
71,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

a = []
for i in range(N - 1):
    for j in range(i + 1, N):
        d = (xy[i][0] - xy[j][0]) * (xy[i][0] - xy[j][0]) + (xy[i][1] - xy[j][1]) * (xy[i][1] - xy[j][1])
        a.append((d, i, j))
a.sort()

result = 0
t = set()
for _, i, j in a:
    if i in t or j in t:
        continue
    if i == 0:
        result += 1
        t.add(j)
    else:
        t.add(i)
        t.add(j)
print(result)
0