結果

問題 No.1265 Balloon Survival
ユーザー lloyzlloyz
提出日時 2022-05-26 00:28:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,691 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 81,804 KB
実行使用メモリ 151,092 KB
最終ジャッジ日時 2023-10-20 19:17:11
合計ジャッジ時間 21,303 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,392 KB
testcase_01 AC 36 ms
53,392 KB
testcase_02 AC 36 ms
53,392 KB
testcase_03 AC 36 ms
53,392 KB
testcase_04 AC 35 ms
53,392 KB
testcase_05 AC 35 ms
53,392 KB
testcase_06 AC 36 ms
53,392 KB
testcase_07 AC 35 ms
53,392 KB
testcase_08 AC 36 ms
53,392 KB
testcase_09 AC 37 ms
53,392 KB
testcase_10 AC 38 ms
53,392 KB
testcase_11 AC 37 ms
53,392 KB
testcase_12 AC 37 ms
53,392 KB
testcase_13 AC 37 ms
53,392 KB
testcase_14 AC 174 ms
76,124 KB
testcase_15 AC 132 ms
70,592 KB
testcase_16 AC 71 ms
64,268 KB
testcase_17 AC 732 ms
101,256 KB
testcase_18 AC 88 ms
67,180 KB
testcase_19 AC 74 ms
64,420 KB
testcase_20 AC 161 ms
74,064 KB
testcase_21 AC 365 ms
94,276 KB
testcase_22 AC 205 ms
77,696 KB
testcase_23 AC 231 ms
79,100 KB
testcase_24 AC 1,645 ms
149,572 KB
testcase_25 AC 1,606 ms
130,668 KB
testcase_26 AC 1,572 ms
131,596 KB
testcase_27 AC 1,579 ms
130,644 KB
testcase_28 AC 1,615 ms
131,592 KB
testcase_29 AC 1,634 ms
151,092 KB
testcase_30 AC 1,538 ms
131,592 KB
testcase_31 AC 1,567 ms
130,644 KB
testcase_32 AC 1,691 ms
150,364 KB
testcase_33 AC 1,565 ms
130,648 KB
testcase_34 AC 36 ms
53,392 KB
testcase_35 AC 34 ms
53,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

L = []
for i in range(n):
    for j in range(i + 1, n):
        L.append(((P[i][0] - P[j][0])**2 + (P[i][1] - P[j][1])**2, i, j))

L.sort()
seen = set()
ans = 0
for _, i, j in L:
    if i == 0:
        if j in seen:
            continue
        ans += 1
        seen.add(j)
    else:
        if i in seen or j in seen:
            continue
        seen.add(i)
        seen.add(j)
print(ans)
0