結果

問題 No.1265 Balloon Survival
コンテスト
ユーザー ああ
提出日時 2026-05-22 20:33:27
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 1,231 ms / 2,000 ms
コード長 345 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 413 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 146,384 KB
最終ジャッジ日時 2026-05-22 20:33:55
合計ジャッジ時間 15,939 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
純コード判定待ち
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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