結果

問題 No.1265 Balloon Survival
ユーザー tonyu0tonyu0
提出日時 2020-10-23 22:16:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 664 bytes
コンパイル時間 1,123 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 76,732 KB
最終ジャッジ日時 2023-09-28 16:08:09
合計ジャッジ時間 5,276 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,296 KB
testcase_01 AC 76 ms
71,116 KB
testcase_02 AC 78 ms
71,444 KB
testcase_03 AC 77 ms
71,332 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 77 ms
71,116 KB
testcase_08 WA -
testcase_09 AC 79 ms
71,492 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 79 ms
71,244 KB
testcase_35 AC 77 ms
71,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.readline
n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, read().split())


def dist(i, j):
    return (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j])


# 取り除いた後に、取り除く必要があるやつが出てくる
#
ds = []
for i in range(1, n):
    ds.append((dist(0, i), i))
ds.sort()
ans = 0
used = [False] * n
for d, i in ds:
    need = True
    for j in range(1, n):
        if i == j or used[j]:
            continue
        e = dist(i, j)
        if d > e:
            need = False
            break
    if need:
        used[i] = True
        ans += 1
print(ans)
0