結果

問題 No.1265 Balloon Survival
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 16:35:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,880 ms / 2,000 ms
コード長 496 bytes
コンパイル時間 819 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 155,164 KB
最終ジャッジ日時 2023-09-03 21:37:09
合計ジャッジ時間 23,810 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,072 KB
testcase_01 AC 73 ms
71,200 KB
testcase_02 AC 74 ms
71,532 KB
testcase_03 AC 76 ms
71,316 KB
testcase_04 AC 76 ms
71,476 KB
testcase_05 AC 74 ms
71,120 KB
testcase_06 AC 74 ms
71,420 KB
testcase_07 AC 74 ms
71,608 KB
testcase_08 AC 74 ms
71,332 KB
testcase_09 AC 73 ms
71,376 KB
testcase_10 AC 73 ms
71,208 KB
testcase_11 AC 74 ms
71,364 KB
testcase_12 AC 74 ms
71,360 KB
testcase_13 AC 74 ms
71,372 KB
testcase_14 AC 206 ms
80,264 KB
testcase_15 AC 169 ms
78,672 KB
testcase_16 AC 107 ms
76,292 KB
testcase_17 AC 782 ms
102,752 KB
testcase_18 AC 128 ms
77,680 KB
testcase_19 AC 114 ms
76,356 KB
testcase_20 AC 201 ms
80,284 KB
testcase_21 AC 413 ms
93,224 KB
testcase_22 AC 252 ms
81,892 KB
testcase_23 AC 295 ms
92,560 KB
testcase_24 AC 1,720 ms
153,336 KB
testcase_25 AC 1,727 ms
154,232 KB
testcase_26 AC 1,710 ms
155,164 KB
testcase_27 AC 1,710 ms
154,328 KB
testcase_28 AC 1,727 ms
154,840 KB
testcase_29 AC 1,880 ms
154,780 KB
testcase_30 AC 1,719 ms
154,840 KB
testcase_31 AC 1,714 ms
154,200 KB
testcase_32 AC 1,738 ms
154,328 KB
testcase_33 AC 1,742 ms
154,392 KB
testcase_34 AC 75 ms
71,408 KB
testcase_35 AC 73 ms
71,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
X = [0] * n
Y = [0] * n
for i in range(n):
    X[i], Y[i] = map(int, input().split())
dist = []
for i in range(n):
    for j in range(i + 1, n):
        dx = X[j] - X[i]
        dy = Y[j] - Y[i]
        dist.append((dx ** 2 + dy ** 2, i, j))
        
dist.sort()
used = [False] * n
ans = 0
for _, i, j in dist:
    if i == 0:
        if not used[j]:
            ans += 1
            used[j] = True
    elif not used[i] and not used[j]:
        used[i] = used[j] = True
print(ans)
0