結果

問題 No.1265 Balloon Survival
ユーザー ayaoniayaoni
提出日時 2020-10-24 07:08:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,768 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 134,696 KB
最終ジャッジ日時 2023-09-28 20:09:01
合計ジャッジ時間 23,818 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,928 KB
testcase_01 AC 74 ms
71,432 KB
testcase_02 AC 74 ms
71,192 KB
testcase_03 AC 74 ms
71,108 KB
testcase_04 AC 75 ms
71,276 KB
testcase_05 AC 76 ms
71,248 KB
testcase_06 AC 75 ms
71,192 KB
testcase_07 AC 77 ms
71,356 KB
testcase_08 AC 75 ms
71,356 KB
testcase_09 AC 76 ms
71,204 KB
testcase_10 AC 75 ms
71,084 KB
testcase_11 AC 75 ms
71,284 KB
testcase_12 AC 75 ms
71,188 KB
testcase_13 AC 74 ms
71,184 KB
testcase_14 AC 216 ms
80,148 KB
testcase_15 AC 171 ms
78,716 KB
testcase_16 AC 110 ms
76,416 KB
testcase_17 AC 801 ms
103,216 KB
testcase_18 AC 129 ms
77,264 KB
testcase_19 AC 115 ms
76,464 KB
testcase_20 AC 205 ms
80,392 KB
testcase_21 AC 435 ms
93,948 KB
testcase_22 AC 255 ms
81,792 KB
testcase_23 AC 274 ms
82,564 KB
testcase_24 AC 1,716 ms
132,772 KB
testcase_25 AC 1,713 ms
133,752 KB
testcase_26 AC 1,710 ms
134,632 KB
testcase_27 AC 1,715 ms
133,540 KB
testcase_28 AC 1,692 ms
134,524 KB
testcase_29 AC 1,732 ms
134,696 KB
testcase_30 AC 1,734 ms
134,432 KB
testcase_31 AC 1,729 ms
133,544 KB
testcase_32 AC 1,768 ms
133,568 KB
testcase_33 AC 1,698 ms
133,560 KB
testcase_34 AC 77 ms
71,364 KB
testcase_35 AC 77 ms
71,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N = I()
xy = [tuple(MI()) for _ in range(N)]
dist = []
for i in range(N-1):
    x0,y0 = xy[i]
    for j in range(i+1,N):
        x1,y1 = xy[j]
        dist.append(((x0-x1)**2+(y0-y1)**2,i,j))

dist.sort()
left = [1]*N

ans = 0
for d,i,j in dist:
    if left[i] == 0 or left[j] == 0:
        continue
    if i == 0:
        ans += 1
        left[j] = 0
    else:
        left[i] = 0
        left[j] = 0

print(ans)
0