結果

問題 No.1137 Circles
ユーザー vwxyz
提出日時 2024-07-17 10:04:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 675 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 38,876 KB
最終ジャッジ日時 2024-07-17 10:04:40
合計ジャッジ時間 9,249 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

def Compress(lst):
    decomp=sorted(list(set(lst)))
    comp={x:i for i,x in enumerate(decomp)}
    return comp,decomp

N=int(input())
L,R=[],[]
for i in range(N):
    x,r=map(int,input().split())
    L.append(x-r)
    R.append(x+r)
comp,decomp=Compress(L+R)
le=len(comp)
imos=[0]*le
for l,r in zip(L,R):
    l,r=comp[l],comp[r]
    imos[l]+=1
    imos[r]-=1
for i in range(1,le):
    imos[i]+=imos[i-1]
ans=max(imos)
print(ans)
0