結果

問題 No.1882 Areas of Triangle
ユーザー lllllll88938494
提出日時 2022-06-22 00:03:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 90,880 KB
最終ジャッジ日時 2024-10-15 01:54:00
合計ジャッジ時間 5,930 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 22 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left as bl , bisect_right as br

n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
ans=0

def  c(x,y):
    return x*y / 2 >= k

def  nb(x):
    ng = 1 
    ok = 10**10
    while ok - ng > 1:
        mid=(ok + ng) // 2
        if c(x,mid):
            ok = mid
        else:
            ng = mid
    return ok
for i in range(n):
    t=nb(a[i])
    ans+= n - bl(a,t)
    
print(ans)

0