結果

問題 No.1265 Balloon Survival
コンテスト
ユーザー ああ
提出日時 2026-05-22 20:33:27
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 1,192 ms / 2,000 ms
+ 528µs
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 66 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 147,728 KB
最終ジャッジ日時 2026-10-01 14:55:16
合計ジャッジ時間 16,136 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n=int(input())
x=[]
y=[]
for i in range(n):
    a,b=map(int,input().split());p=0
    for j,l in x:
        y.append(((a-j)**2+(b-l)**2,i,p))
        p+=1
    x.append((a,b))
y.sort()
ans=0;a=[0]*n
for i,j,l in y:
    if a[j] or a[l]:
        continue
    if not j or not l:
        ans+=1;a[max(j,l)]=1
    else:
        a[j]=1;a[l]=1
print(ans)
0