結果

問題 No.1265 Balloon Survival
ユーザー 👑 tamatotamato
提出日時 2020-10-23 22:09:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 795 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,396 KB
実行使用メモリ 139,344 KB
最終ジャッジ日時 2023-09-28 15:57:10
合計ジャッジ時間 16,443 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,476 KB
testcase_01 AC 75 ms
71,848 KB
testcase_02 AC 78 ms
71,684 KB
testcase_03 AC 77 ms
71,608 KB
testcase_04 AC 76 ms
71,508 KB
testcase_05 AC 77 ms
71,608 KB
testcase_06 AC 75 ms
71,792 KB
testcase_07 AC 77 ms
71,960 KB
testcase_08 AC 77 ms
71,880 KB
testcase_09 AC 76 ms
71,500 KB
testcase_10 AC 77 ms
71,768 KB
testcase_11 AC 78 ms
71,760 KB
testcase_12 AC 78 ms
71,936 KB
testcase_13 AC 76 ms
71,872 KB
testcase_14 AC 166 ms
85,272 KB
testcase_15 AC 160 ms
83,676 KB
testcase_16 AC 100 ms
76,588 KB
testcase_17 AC 579 ms
110,732 KB
testcase_18 AC 114 ms
77,548 KB
testcase_19 AC 101 ms
76,664 KB
testcase_20 AC 170 ms
85,412 KB
testcase_21 AC 295 ms
89,264 KB
testcase_22 AC 193 ms
85,444 KB
testcase_23 AC 222 ms
86,664 KB
testcase_24 AC 1,071 ms
138,880 KB
testcase_25 AC 1,081 ms
138,860 KB
testcase_26 AC 1,175 ms
139,104 KB
testcase_27 AC 1,111 ms
138,804 KB
testcase_28 AC 1,115 ms
139,344 KB
testcase_29 AC 1,167 ms
139,280 KB
testcase_30 AC 1,161 ms
138,832 KB
testcase_31 AC 1,118 ms
139,044 KB
testcase_32 AC 1,181 ms
139,236 KB
testcase_33 AC 1,220 ms
139,316 KB
testcase_34 AC 79 ms
71,968 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import hypot
    input = sys.stdin.readline

    N = int(input())
    X = []
    Y = []
    for _ in range(N):
        x, y = map(int, input().split())
        X.append(x)
        Y.append(y)

    ev = []
    for i in range(N):
        xi, yi = X[i], Y[i]
        for j in range(i+1, N):
            xj, yj = X[j], Y[j]
            ev.append((hypot(xi-xj, yi-yj), i, j))
    ev.sort(key=lambda x: x[0])
    seen = [0] * N
    ans = 0
    for _, i, j in ev:
        if i == 0:
            if not seen[j]:
                ans += 1
                seen[j] = 1
        else:
            if seen[i] == seen[j] == 0:
                seen[i] = 1
                seen[j] = 1
    print(ans)


if __name__ == '__main__':
    main()
0