結果

問題 No.1265 Balloon Survival
ユーザー ああ
提出日時 2026-05-22 20:33:27
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 1,121 ms / 2,000 ms
+ 15µs
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,281 ms
コンパイル使用メモリ 64,372 KB
実行使用メモリ 136,892 KB
最終ジャッジ日時 2026-11-13 13:04:17
合計ジャッジ時間 17,640 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

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