結果

問題 No.1265 Balloon Survival
ユーザー tpynerivertpyneriver
提出日時 2020-10-23 22:19:39
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,661 ms / 2,000 ms
コード長 681 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 179,636 KB
最終ジャッジ日時 2023-09-28 16:14:05
合計ジャッジ時間 22,276 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
71,340 KB
testcase_01 AC 82 ms
71,336 KB
testcase_02 AC 84 ms
71,464 KB
testcase_03 AC 83 ms
71,272 KB
testcase_04 AC 83 ms
71,576 KB
testcase_05 AC 84 ms
71,588 KB
testcase_06 AC 81 ms
71,500 KB
testcase_07 AC 83 ms
71,592 KB
testcase_08 AC 82 ms
71,296 KB
testcase_09 AC 81 ms
71,288 KB
testcase_10 AC 82 ms
71,160 KB
testcase_11 AC 83 ms
71,464 KB
testcase_12 AC 83 ms
71,424 KB
testcase_13 AC 80 ms
71,264 KB
testcase_14 AC 212 ms
84,504 KB
testcase_15 AC 180 ms
83,060 KB
testcase_16 AC 121 ms
76,740 KB
testcase_17 AC 799 ms
122,824 KB
testcase_18 AC 140 ms
81,960 KB
testcase_19 AC 130 ms
80,444 KB
testcase_20 AC 207 ms
84,624 KB
testcase_21 AC 371 ms
99,372 KB
testcase_22 AC 285 ms
93,756 KB
testcase_23 AC 287 ms
97,228 KB
testcase_24 AC 1,631 ms
174,316 KB
testcase_25 AC 1,635 ms
175,820 KB
testcase_26 AC 1,586 ms
179,636 KB
testcase_27 AC 1,623 ms
172,772 KB
testcase_28 AC 1,636 ms
174,772 KB
testcase_29 AC 1,637 ms
174,504 KB
testcase_30 AC 1,661 ms
174,448 KB
testcase_31 AC 1,602 ms
174,752 KB
testcase_32 AC 1,614 ms
173,772 KB
testcase_33 AC 1,594 ms
175,100 KB
testcase_34 AC 83 ms
71,496 KB
testcase_35 AC 83 ms
71,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline
from operator import itemgetter


N = int(readline())
Points = [tuple(map(int, readline().split())) for _ in range(N)]

dis = [[0]*N for _ in range(N)]
for i in range(N):
    x, y = Points[i]
    for j in range(i):
        x1, y1 = Points[j]
        dis[i][j] = (x-x1)*(x-x1) + (y-y1)*(y-y1)

K = [(dis[i][j]*1000+N-1-j, i, j) for i in range(N) for j in range(i)]
K.sort(key = itemgetter(0))
vanish = set()
ans = 0
for _, i, j in K:
    if j == 0:
        if i not in vanish:
            vanish.add(i)
            ans += 1
        continue
    if i not in vanish and j not in vanish:
        vanish.add(i)
        vanish.add(j)

print(ans)
0