結果

問題 No.1265 Balloon Survival
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-10-23 22:49:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,368 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 1,164 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 152,216 KB
最終ジャッジ日時 2023-09-28 17:13:39
合計ジャッジ時間 19,561 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,368 KB
testcase_01 AC 77 ms
71,068 KB
testcase_02 AC 74 ms
71,216 KB
testcase_03 AC 75 ms
71,088 KB
testcase_04 AC 76 ms
71,460 KB
testcase_05 AC 79 ms
71,252 KB
testcase_06 AC 78 ms
71,256 KB
testcase_07 AC 77 ms
71,340 KB
testcase_08 AC 78 ms
71,376 KB
testcase_09 AC 77 ms
71,216 KB
testcase_10 AC 77 ms
71,280 KB
testcase_11 AC 78 ms
71,488 KB
testcase_12 AC 78 ms
71,248 KB
testcase_13 AC 77 ms
71,332 KB
testcase_14 AC 172 ms
80,456 KB
testcase_15 AC 146 ms
78,864 KB
testcase_16 AC 104 ms
76,532 KB
testcase_17 AC 675 ms
123,176 KB
testcase_18 AC 116 ms
77,400 KB
testcase_19 AC 109 ms
76,644 KB
testcase_20 AC 174 ms
80,428 KB
testcase_21 AC 320 ms
93,036 KB
testcase_22 AC 228 ms
91,536 KB
testcase_23 AC 248 ms
92,552 KB
testcase_24 AC 1,335 ms
151,804 KB
testcase_25 AC 1,322 ms
151,768 KB
testcase_26 AC 1,287 ms
151,844 KB
testcase_27 AC 1,308 ms
151,680 KB
testcase_28 AC 1,304 ms
151,864 KB
testcase_29 AC 1,368 ms
151,948 KB
testcase_30 AC 1,329 ms
152,048 KB
testcase_31 AC 1,325 ms
152,216 KB
testcase_32 AC 1,332 ms
151,848 KB
testcase_33 AC 1,301 ms
152,152 KB
testcase_34 AC 79 ms
71,452 KB
testcase_35 AC 76 ms
71,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, = map(int, input().split())
X = []
for i in range(N):
    a, b = map(int, input().split())
    X.append((a, b))
K = []
for i in range(N):
    x, y = X[i]
    for j in range(i+1, N):
        z, w = X[j]
        r = (x-z)**2+(y-w)**2
        K.append((i, j, r))
K.sort(key=lambda x:x[2])
vs = set()
R = 0
for i, j, r in K:
    if i not in vs and j not in vs:
        if i == 0:
            vs.add(j)
            R += 1
        else:
            vs.add(i)
            vs.add(j)
print(R)
0