結果

問題 No.1265 Balloon Survival
ユーザー MineMine
提出日時 2020-12-03 23:41:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,559 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 128,092 KB
最終ジャッジ日時 2023-10-12 10:13:52
合計ジャッジ時間 20,636 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,348 KB
testcase_01 AC 73 ms
71,476 KB
testcase_02 AC 72 ms
71,408 KB
testcase_03 AC 72 ms
71,504 KB
testcase_04 AC 73 ms
71,480 KB
testcase_05 AC 74 ms
71,144 KB
testcase_06 AC 74 ms
71,252 KB
testcase_07 AC 73 ms
71,316 KB
testcase_08 AC 73 ms
71,248 KB
testcase_09 AC 73 ms
71,364 KB
testcase_10 AC 73 ms
71,540 KB
testcase_11 AC 72 ms
71,404 KB
testcase_12 AC 73 ms
71,144 KB
testcase_13 AC 72 ms
71,440 KB
testcase_14 AC 221 ms
83,560 KB
testcase_15 AC 184 ms
82,572 KB
testcase_16 AC 123 ms
78,460 KB
testcase_17 AC 765 ms
112,308 KB
testcase_18 AC 143 ms
80,072 KB
testcase_19 AC 131 ms
78,768 KB
testcase_20 AC 221 ms
83,404 KB
testcase_21 AC 390 ms
91,092 KB
testcase_22 AC 268 ms
84,880 KB
testcase_23 AC 288 ms
85,860 KB
testcase_24 AC 1,495 ms
127,480 KB
testcase_25 AC 1,493 ms
127,280 KB
testcase_26 AC 1,559 ms
127,660 KB
testcase_27 AC 1,492 ms
127,584 KB
testcase_28 AC 1,479 ms
127,820 KB
testcase_29 AC 1,530 ms
127,128 KB
testcase_30 AC 1,501 ms
127,260 KB
testcase_31 AC 1,520 ms
127,752 KB
testcase_32 AC 1,545 ms
127,548 KB
testcase_33 AC 1,510 ms
128,092 KB
testcase_34 AC 74 ms
71,440 KB
testcase_35 AC 74 ms
71,252 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, x in d:
    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