結果

問題 No.1265 Balloon Survival
ユーザー r_ishidar_ishida
提出日時 2020-12-30 07:22:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,926 ms / 2,000 ms
コード長 682 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 82,092 KB
実行使用メモリ 134,032 KB
最終ジャッジ日時 2024-04-16 03:35:24
合計ジャッジ時間 23,371 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,096 KB
testcase_01 AC 40 ms
52,096 KB
testcase_02 AC 41 ms
51,840 KB
testcase_03 AC 41 ms
51,840 KB
testcase_04 AC 40 ms
52,224 KB
testcase_05 AC 40 ms
51,968 KB
testcase_06 AC 41 ms
51,712 KB
testcase_07 AC 40 ms
51,968 KB
testcase_08 AC 40 ms
51,968 KB
testcase_09 AC 40 ms
52,224 KB
testcase_10 AC 40 ms
51,712 KB
testcase_11 AC 40 ms
51,968 KB
testcase_12 AC 42 ms
51,712 KB
testcase_13 AC 40 ms
52,224 KB
testcase_14 AC 183 ms
74,496 KB
testcase_15 AC 142 ms
71,168 KB
testcase_16 AC 80 ms
63,232 KB
testcase_17 AC 843 ms
101,660 KB
testcase_18 AC 98 ms
65,280 KB
testcase_19 AC 82 ms
64,000 KB
testcase_20 AC 181 ms
74,624 KB
testcase_21 AC 448 ms
97,280 KB
testcase_22 AC 230 ms
77,312 KB
testcase_23 AC 253 ms
79,360 KB
testcase_24 AC 1,793 ms
133,576 KB
testcase_25 AC 1,854 ms
132,948 KB
testcase_26 AC 1,863 ms
133,460 KB
testcase_27 AC 1,850 ms
132,828 KB
testcase_28 AC 1,859 ms
132,824 KB
testcase_29 AC 1,896 ms
133,676 KB
testcase_30 AC 1,920 ms
133,860 KB
testcase_31 AC 1,845 ms
132,448 KB
testcase_32 AC 1,926 ms
133,748 KB
testcase_33 AC 1,859 ms
134,032 KB
testcase_34 AC 42 ms
52,096 KB
testcase_35 AC 40 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())

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

a,b = MI()
x.append(a)
y.append(b)

for i in range(1, n):
    a,b = MI()
    x.append(a)
    y.append(b)
    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