結果

問題 No.1265 Balloon Survival
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-10-23 23:19:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 580 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 134,288 KB
最終ジャッジ日時 2023-09-28 18:33:06
合計ジャッジ時間 23,271 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,836 KB
testcase_01 AC 73 ms
71,844 KB
testcase_02 AC 71 ms
71,448 KB
testcase_03 AC 73 ms
71,344 KB
testcase_04 AC 73 ms
71,712 KB
testcase_05 AC 74 ms
71,736 KB
testcase_06 AC 74 ms
71,652 KB
testcase_07 AC 72 ms
71,572 KB
testcase_08 AC 72 ms
71,916 KB
testcase_09 AC 74 ms
71,864 KB
testcase_10 AC 73 ms
71,340 KB
testcase_11 AC 73 ms
71,744 KB
testcase_12 AC 74 ms
71,716 KB
testcase_13 AC 73 ms
71,816 KB
testcase_14 AC 206 ms
80,364 KB
testcase_15 AC 168 ms
79,192 KB
testcase_16 AC 108 ms
76,836 KB
testcase_17 AC 831 ms
103,064 KB
testcase_18 AC 135 ms
77,792 KB
testcase_19 AC 114 ms
77,156 KB
testcase_20 AC 203 ms
80,808 KB
testcase_21 AC 434 ms
94,696 KB
testcase_22 AC 254 ms
82,232 KB
testcase_23 AC 274 ms
82,948 KB
testcase_24 AC 1,796 ms
132,432 KB
testcase_25 AC 1,768 ms
133,404 KB
testcase_26 AC 1,785 ms
134,240 KB
testcase_27 AC 1,760 ms
133,396 KB
testcase_28 AC 1,747 ms
134,280 KB
testcase_29 AC 1,768 ms
134,176 KB
testcase_30 AC 1,732 ms
134,288 KB
testcase_31 AC 1,749 ms
133,212 KB
testcase_32 AC 1,766 ms
133,412 KB
testcase_33 AC 1,774 ms
133,572 KB
testcase_34 AC 76 ms
71,920 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]

l = []
for i in range(n-1):
    for j in range(i+1,n):
        dis = ((xy[i][0]-xy[j][0])**2+(xy[i][1]-xy[j][1])**2)**0.5
        l.append((dis,i,j))

ans = 0
count = [1]*n
l.sort()
su = n
for dis,i,j in l:
    if count[i] == 0 or count[j] == 0:
        continue
    if i != 0:
        count[i] -= 1
        count[j] -= 1
        su -= 2
    if i == 0:
        ans += 1
        count[j] -= 1
        su -= 1
    if su == 1:
        print(ans)
        exit()
print(ans)
0