結果

問題 No.1265 Balloon Survival
ユーザー MineMine
提出日時 2020-12-03 23:42:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,586 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 128,140 KB
最終ジャッジ日時 2023-10-12 10:15:32
合計ジャッジ時間 21,493 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,660 KB
testcase_01 AC 75 ms
71,376 KB
testcase_02 AC 73 ms
71,512 KB
testcase_03 AC 73 ms
71,348 KB
testcase_04 AC 72 ms
71,520 KB
testcase_05 AC 73 ms
71,292 KB
testcase_06 AC 76 ms
71,400 KB
testcase_07 AC 76 ms
71,300 KB
testcase_08 AC 75 ms
71,136 KB
testcase_09 AC 74 ms
71,436 KB
testcase_10 AC 77 ms
71,376 KB
testcase_11 AC 75 ms
71,508 KB
testcase_12 AC 74 ms
71,460 KB
testcase_13 AC 75 ms
71,532 KB
testcase_14 AC 230 ms
83,544 KB
testcase_15 AC 191 ms
82,652 KB
testcase_16 AC 130 ms
78,472 KB
testcase_17 AC 793 ms
112,616 KB
testcase_18 AC 146 ms
79,984 KB
testcase_19 AC 132 ms
78,520 KB
testcase_20 AC 228 ms
83,856 KB
testcase_21 AC 402 ms
91,240 KB
testcase_22 AC 275 ms
84,880 KB
testcase_23 AC 291 ms
85,872 KB
testcase_24 AC 1,572 ms
127,660 KB
testcase_25 AC 1,561 ms
127,500 KB
testcase_26 AC 1,564 ms
127,784 KB
testcase_27 AC 1,570 ms
127,468 KB
testcase_28 AC 1,547 ms
128,140 KB
testcase_29 AC 1,586 ms
127,488 KB
testcase_30 AC 1,568 ms
127,312 KB
testcase_31 AC 1,559 ms
127,880 KB
testcase_32 AC 1,576 ms
127,608 KB
testcase_33 AC 1,549 ms
128,124 KB
testcase_34 AC 75 ms
71,300 KB
testcase_35 AC 73 ms
71,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def distance(X, Y):
    return abs(X[0] - Y[0])**2 + abs(X[1] - Y[1])**2

n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
d = []

for i in range(n):
    for g in range(i+1, n):
        d.append((distance(xy[i], xy[g]), (i, g)))
d.sort()

cnt = 0
used = [False]*n

for i in range(len(d)):
    x = d[i][1]
    if used[x[0]] or used[x[1]]:
        continue
    if x[0] == 0:
        cnt += 1
        used[x[1]] = True
    else:
        used[x[0]] = True
        used[x[1]] = True

print(cnt)

0