結果

問題 No.1265 Balloon Survival
ユーザー kohei2019kohei2019
提出日時 2022-07-19 21:57:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,805 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 155,024 KB
最終ジャッジ日時 2023-09-14 18:50:04
合計ジャッジ時間 23,802 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,336 KB
testcase_01 AC 72 ms
71,108 KB
testcase_02 AC 71 ms
71,304 KB
testcase_03 AC 71 ms
71,124 KB
testcase_04 AC 73 ms
71,288 KB
testcase_05 AC 74 ms
71,344 KB
testcase_06 AC 72 ms
71,164 KB
testcase_07 AC 72 ms
71,224 KB
testcase_08 AC 72 ms
71,252 KB
testcase_09 AC 72 ms
71,316 KB
testcase_10 AC 73 ms
71,104 KB
testcase_11 AC 71 ms
71,304 KB
testcase_12 AC 73 ms
71,228 KB
testcase_13 AC 73 ms
70,916 KB
testcase_14 AC 207 ms
80,536 KB
testcase_15 AC 172 ms
78,764 KB
testcase_16 AC 109 ms
76,204 KB
testcase_17 AC 803 ms
101,824 KB
testcase_18 AC 128 ms
77,272 KB
testcase_19 AC 111 ms
76,548 KB
testcase_20 AC 201 ms
80,144 KB
testcase_21 AC 414 ms
91,740 KB
testcase_22 AC 273 ms
91,192 KB
testcase_23 AC 292 ms
92,580 KB
testcase_24 AC 1,732 ms
153,288 KB
testcase_25 AC 1,723 ms
154,780 KB
testcase_26 AC 1,773 ms
154,872 KB
testcase_27 AC 1,805 ms
154,324 KB
testcase_28 AC 1,703 ms
155,024 KB
testcase_29 AC 1,779 ms
154,888 KB
testcase_30 AC 1,755 ms
154,692 KB
testcase_31 AC 1,755 ms
154,680 KB
testcase_32 AC 1,758 ms
154,356 KB
testcase_33 AC 1,729 ms
154,788 KB
testcase_34 AC 72 ms
71,240 KB
testcase_35 AC 72 ms
71,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsxy = [tuple(map(int,input().split())) for i in range(N)]
ls = []
for i in range(N-1):
    for j in range(i+1,N):
        dist = (lsxy[i][0]-lsxy[j][0])**2 + (lsxy[i][1]-lsxy[j][1])**2
        ls.append((dist,i,j))
ls.sort()
setrm = []
used = [False]*N
for i in range(len(ls)):
    d,a,b = ls[i]
    if a == 0 and used[b] == False:
        used[b] = True
        setrm.append(b)
    elif used[a] or used[b]:
        continue
    else:
        used[a] = True
        used[b] = True
print(len(setrm))
0