結果

問題 No.1265 Balloon Survival
ユーザー r_ishidar_ishida
提出日時 2020-12-30 06:58:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 998 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 61,920 KB
最終ジャッジ日時 2024-04-16 03:12:31
合計ジャッジ時間 5,522 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
17,952 KB
testcase_01 AC 36 ms
10,880 KB
testcase_02 AC 34 ms
11,008 KB
testcase_03 AC 34 ms
10,752 KB
testcase_04 AC 32 ms
10,880 KB
testcase_05 AC 33 ms
10,752 KB
testcase_06 AC 36 ms
10,880 KB
testcase_07 AC 33 ms
10,880 KB
testcase_08 AC 36 ms
10,880 KB
testcase_09 AC 34 ms
10,880 KB
testcase_10 AC 35 ms
10,880 KB
testcase_11 AC 35 ms
10,880 KB
testcase_12 AC 32 ms
10,880 KB
testcase_13 AC 32 ms
10,880 KB
testcase_14 AC 438 ms
20,352 KB
testcase_15 AC 291 ms
17,792 KB
testcase_16 AC 96 ms
13,440 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import itertools
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
x = []
y = []
d = []

for i in range(n):
    a,b = MI()
    x.append(a)
    y.append(b)

for i in range(1, n):
    for j in range(i):
        tmp = (x[i]-x[j])**2 + (y[i]-y[j])**2
        d.append([tmp, i, j])

d.sort()

deleted = []
ans = 0

for i in d:
    if i[1] == 0:
        if i[2] not in deleted:
            deleted.append(i[2])
            ans += 1
    elif i[2] == 0:
        if i[1] not in deleted:
            deleted.append(i[1])
            ans += 1
    else:
        if (i[1] not in deleted) and (i[2] not in deleted):
            deleted.append(i[1])
            deleted.append(i[2])

print(ans)
0