結果

問題 No.1265 Balloon Survival
ユーザー r_ishidar_ishida
提出日時 2020-12-30 07:09:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 981 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 96,720 KB
最終ジャッジ日時 2024-04-16 03:24:29
合計ジャッジ時間 9,007 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
11,008 KB
testcase_01 AC 34 ms
10,880 KB
testcase_02 AC 33 ms
11,008 KB
testcase_03 AC 33 ms
11,008 KB
testcase_04 AC 33 ms
10,880 KB
testcase_05 AC 32 ms
11,008 KB
testcase_06 AC 33 ms
10,880 KB
testcase_07 AC 33 ms
10,880 KB
testcase_08 AC 33 ms
11,008 KB
testcase_09 AC 33 ms
11,008 KB
testcase_10 AC 33 ms
10,880 KB
testcase_11 AC 33 ms
11,008 KB
testcase_12 AC 33 ms
10,880 KB
testcase_13 AC 32 ms
10,880 KB
testcase_14 AC 241 ms
20,352 KB
testcase_15 AC 181 ms
17,792 KB
testcase_16 AC 74 ms
13,440 KB
testcase_17 AC 1,274 ms
54,976 KB
testcase_18 AC 99 ms
14,720 KB
testcase_19 AC 78 ms
13,696 KB
testcase_20 AC 227 ms
20,096 KB
testcase_21 AC 559 ms
31,788 KB
testcase_22 AC 324 ms
23,552 KB
testcase_23 AC 364 ms
24,832 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 AC 33 ms
10,880 KB
testcase_35 AC 32 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

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 = [1]*n
ans = 0

for i in d:
    if i[1] == 0:
        if deleted[i[2]] == 1:
            deleted[i[2]] = 0
            ans += 1
    elif i[2] == 0:
        if deleted[i[1]] == 1:
            deleted[i[1]] = 0
            ans += 1
    else:
        if deleted[i[1]] == 1 and deleted[i[2]] == 1:
            deleted[i[1]] = 0
            deleted[i[2]] = 0

print(ans)
0