結果

問題 No.1265 Balloon Survival
ユーザー ああいいああいい
提出日時 2022-02-19 16:32:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,208 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 152,020 KB
最終ジャッジ日時 2023-09-11 20:42:59
合計ジャッジ時間 17,315 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,584 KB
testcase_01 AC 70 ms
71,400 KB
testcase_02 AC 70 ms
71,304 KB
testcase_03 AC 75 ms
71,380 KB
testcase_04 AC 71 ms
71,148 KB
testcase_05 AC 71 ms
71,160 KB
testcase_06 AC 70 ms
71,300 KB
testcase_07 AC 70 ms
71,300 KB
testcase_08 AC 70 ms
71,360 KB
testcase_09 AC 69 ms
71,432 KB
testcase_10 AC 72 ms
71,400 KB
testcase_11 AC 71 ms
71,044 KB
testcase_12 AC 68 ms
71,148 KB
testcase_13 AC 70 ms
71,316 KB
testcase_14 AC 181 ms
87,236 KB
testcase_15 AC 131 ms
78,964 KB
testcase_16 AC 94 ms
76,608 KB
testcase_17 AC 572 ms
123,276 KB
testcase_18 AC 106 ms
77,548 KB
testcase_19 AC 95 ms
76,616 KB
testcase_20 AC 152 ms
80,320 KB
testcase_21 AC 273 ms
93,144 KB
testcase_22 AC 201 ms
91,660 KB
testcase_23 AC 214 ms
92,568 KB
testcase_24 AC 1,169 ms
151,820 KB
testcase_25 AC 1,121 ms
151,800 KB
testcase_26 AC 1,128 ms
151,984 KB
testcase_27 AC 1,127 ms
151,976 KB
testcase_28 AC 1,130 ms
151,720 KB
testcase_29 AC 1,173 ms
152,020 KB
testcase_30 AC 1,145 ms
151,840 KB
testcase_31 AC 1,169 ms
151,748 KB
testcase_32 AC 1,208 ms
152,008 KB
testcase_33 AC 1,197 ms
151,892 KB
testcase_34 AC 71 ms
71,408 KB
testcase_35 AC 71 ms
71,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i],y[i] = map(int,input().split())
l = []
for i in range(N):
    for j in range(i+1,N):
        s = (x[i]-x[j]) ** 2
        t = (y[i]-y[j]) ** 2
        l.append((s+t,i,j))
l.sort(key = lambda x:x[0])
s = set()
ans = 0
for d,i,j in l:
    if i == 0 or j == 0:
        if j == 0:
            i,j = j,i
        if j not in s:
            ans += 1
            s.add(j)
    else:
        if i not in s and j not in s:
            s.add(i)
            s.add(j)
print(ans)
0