結果

問題 No.1265 Balloon Survival
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2020-10-23 23:14:42
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 446 bytes
コンパイル時間 700 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 140,848 KB
最終ジャッジ日時 2023-09-28 18:26:23
合計ジャッジ時間 27,805 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,256 KB
testcase_01 AC 78 ms
71,252 KB
testcase_02 AC 79 ms
71,228 KB
testcase_03 AC 78 ms
71,272 KB
testcase_04 AC 78 ms
71,468 KB
testcase_05 AC 79 ms
71,332 KB
testcase_06 AC 80 ms
71,328 KB
testcase_07 AC 77 ms
71,540 KB
testcase_08 AC 78 ms
71,476 KB
testcase_09 AC 78 ms
71,224 KB
testcase_10 AC 78 ms
71,552 KB
testcase_11 AC 78 ms
71,348 KB
testcase_12 AC 77 ms
71,256 KB
testcase_13 AC 78 ms
71,420 KB
testcase_14 AC 330 ms
85,764 KB
testcase_15 AC 200 ms
83,352 KB
testcase_16 AC 117 ms
76,312 KB
testcase_17 AC 1,050 ms
113,448 KB
testcase_18 AC 145 ms
80,248 KB
testcase_19 AC 121 ms
76,424 KB
testcase_20 AC 241 ms
85,716 KB
testcase_21 AC 479 ms
94,112 KB
testcase_22 AC 307 ms
88,992 KB
testcase_23 AC 331 ms
90,256 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 78 ms
71,488 KB
testcase_35 AC 77 ms
71,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]

l = []
for i in range(n-1):
    for j in range(i+1,n):
        dis = (xy[i][0]-xy[j][0])**2+(xy[i][1]-xy[j][1])**2
        l.append([dis,i,j])

ans = 0
count = [1]*n
l.sort()
for dis,i,j in l:
    if count[i] == 0 or count[j] == 0:
        continue
    if i != 0:
        count[i] -= 1
        count[j] -= 1
    if i == 0:
        ans += 1
        count[j] -= 1
print(ans)
0