結果

問題 No.1265 Balloon Survival
ユーザー r_ishidar_ishida
提出日時 2020-12-30 07:14:08
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 981 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 135,844 KB
最終ジャッジ日時 2024-04-16 03:28:26
合計ジャッジ時間 26,256 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
52,224 KB
testcase_01 AC 41 ms
52,720 KB
testcase_02 AC 40 ms
51,840 KB
testcase_03 AC 41 ms
52,864 KB
testcase_04 AC 42 ms
52,480 KB
testcase_05 AC 42 ms
52,608 KB
testcase_06 AC 41 ms
52,352 KB
testcase_07 AC 42 ms
52,096 KB
testcase_08 AC 41 ms
52,224 KB
testcase_09 AC 42 ms
52,352 KB
testcase_10 AC 41 ms
52,736 KB
testcase_11 AC 42 ms
52,352 KB
testcase_12 AC 42 ms
52,864 KB
testcase_13 AC 41 ms
52,480 KB
testcase_14 AC 222 ms
84,608 KB
testcase_15 AC 170 ms
82,120 KB
testcase_16 AC 82 ms
70,400 KB
testcase_17 AC 1,009 ms
109,324 KB
testcase_18 AC 113 ms
79,104 KB
testcase_19 AC 87 ms
71,552 KB
testcase_20 AC 219 ms
84,744 KB
testcase_21 AC 469 ms
96,156 KB
testcase_22 AC 280 ms
87,552 KB
testcase_23 AC 310 ms
89,088 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 42 ms
52,480 KB
testcase_35 AC 41 ms
52,224 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