結果

問題 No.1265 Balloon Survival
ユーザー Coki628Coki628
提出日時 2020-12-05 01:53:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,270 bytes
コンパイル時間 1,154 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 147,080 KB
最終ジャッジ日時 2023-10-13 13:04:05
合計ジャッジ時間 14,185 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,408 KB
testcase_01 AC 63 ms
71,572 KB
testcase_02 AC 62 ms
71,392 KB
testcase_03 AC 64 ms
71,456 KB
testcase_04 AC 63 ms
71,576 KB
testcase_05 AC 63 ms
71,552 KB
testcase_06 AC 63 ms
71,576 KB
testcase_07 AC 67 ms
71,568 KB
testcase_08 AC 66 ms
71,516 KB
testcase_09 AC 68 ms
71,800 KB
testcase_10 AC 65 ms
71,580 KB
testcase_11 AC 64 ms
71,768 KB
testcase_12 AC 63 ms
71,576 KB
testcase_13 AC 63 ms
71,460 KB
testcase_14 AC 154 ms
84,200 KB
testcase_15 AC 120 ms
82,524 KB
testcase_16 AC 83 ms
76,924 KB
testcase_17 AC 446 ms
108,228 KB
testcase_18 AC 98 ms
81,072 KB
testcase_19 AC 85 ms
76,912 KB
testcase_20 AC 141 ms
83,764 KB
testcase_21 AC 238 ms
97,424 KB
testcase_22 AC 164 ms
85,392 KB
testcase_23 AC 173 ms
86,168 KB
testcase_24 AC 885 ms
145,456 KB
testcase_25 AC 892 ms
146,524 KB
testcase_26 AC 918 ms
147,072 KB
testcase_27 AC 960 ms
146,632 KB
testcase_28 AC 911 ms
146,920 KB
testcase_29 AC 930 ms
147,080 KB
testcase_30 AC 913 ms
146,900 KB
testcase_31 AC 909 ms
146,600 KB
testcase_32 AC 972 ms
146,444 KB
testcase_33 AC 967 ms
146,424 KB
testcase_34 AC 75 ms
71,624 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import hypot
from operator import itemgetter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for k in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10**9)
INF = 10**19
MOD = 10**9 + 7
EPS = 10**-10

N = INT()
XY = [()] * N
for i in range(N):
    x, y = MAP()
    XY[i] = (x, y)

edges = []
for i, (x, y) in enumerate(XY):
    for j, (x2, y2) in enumerate(XY[i+1:], i+1):
        dist = hypot(x-x2, y-y2) / 2
        edges.append((dist, i, j))

edges.sort(key=itemgetter(0))
removed = [0] * N
ans = 0
for dist, a, b in edges:
    if removed[a] or removed[b]:
        continue
    if a == 0:
        ans += 1
        removed[b] = 1
    elif b == 0:
        ans += 1
        removed[a] = 1
    else:
        removed[a] = 1
        removed[b] = 1
print(ans)
0