結果

問題 No.1265 Balloon Survival
ユーザー r_ishidar_ishida
提出日時 2020-12-30 07:19:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,949 ms / 2,000 ms
コード長 875 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 133,916 KB
最終ジャッジ日時 2024-04-16 03:32:24
合計ジャッジ時間 23,525 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
51,840 KB
testcase_01 AC 45 ms
52,224 KB
testcase_02 AC 41 ms
52,096 KB
testcase_03 AC 42 ms
52,096 KB
testcase_04 AC 44 ms
52,480 KB
testcase_05 AC 42 ms
52,096 KB
testcase_06 AC 42 ms
51,968 KB
testcase_07 AC 42 ms
51,968 KB
testcase_08 AC 43 ms
52,224 KB
testcase_09 AC 44 ms
51,968 KB
testcase_10 AC 42 ms
52,352 KB
testcase_11 AC 42 ms
52,224 KB
testcase_12 AC 43 ms
52,736 KB
testcase_13 AC 43 ms
52,096 KB
testcase_14 AC 190 ms
73,728 KB
testcase_15 AC 149 ms
70,144 KB
testcase_16 AC 83 ms
63,872 KB
testcase_17 AC 850 ms
101,280 KB
testcase_18 AC 103 ms
65,536 KB
testcase_19 AC 87 ms
63,872 KB
testcase_20 AC 185 ms
73,728 KB
testcase_21 AC 452 ms
97,152 KB
testcase_22 AC 237 ms
76,800 KB
testcase_23 AC 256 ms
78,464 KB
testcase_24 AC 1,807 ms
132,636 KB
testcase_25 AC 1,854 ms
133,144 KB
testcase_26 AC 1,819 ms
133,532 KB
testcase_27 AC 1,781 ms
131,744 KB
testcase_28 AC 1,777 ms
132,512 KB
testcase_29 AC 1,813 ms
133,024 KB
testcase_30 AC 1,790 ms
133,532 KB
testcase_31 AC 1,785 ms
132,892 KB
testcase_32 AC 1,949 ms
132,644 KB
testcase_33 AC 1,882 ms
133,916 KB
testcase_34 AC 45 ms
52,480 KB
testcase_35 AC 44 ms
52,096 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[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