結果

問題 No.1882 Areas of Triangle
ユーザー lllllll88938494lllllll88938494
提出日時 2022-06-22 00:15:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 802 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 91,176 KB
最終ジャッジ日時 2024-04-23 02:43:57
合計ジャッジ時間 5,143 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,356 KB
testcase_01 AC 38 ms
52,328 KB
testcase_02 AC 38 ms
52,684 KB
testcase_03 AC 36 ms
53,176 KB
testcase_04 AC 802 ms
89,524 KB
testcase_05 AC 535 ms
91,176 KB
testcase_06 AC 738 ms
90,960 KB
testcase_07 AC 36 ms
53,568 KB
testcase_08 AC 37 ms
52,756 KB
testcase_09 AC 35 ms
52,824 KB
testcase_10 AC 36 ms
52,412 KB
testcase_11 AC 34 ms
53,724 KB
testcase_12 AC 35 ms
53,508 KB
testcase_13 AC 35 ms
52,936 KB
testcase_14 AC 37 ms
52,748 KB
testcase_15 AC 38 ms
52,608 KB
testcase_16 AC 53 ms
64,000 KB
testcase_17 AC 62 ms
69,156 KB
testcase_18 AC 59 ms
70,308 KB
testcase_19 AC 113 ms
76,136 KB
testcase_20 AC 111 ms
76,368 KB
testcase_21 AC 84 ms
76,004 KB
testcase_22 AC 147 ms
76,456 KB
testcase_23 AC 300 ms
78,872 KB
testcase_24 AC 197 ms
78,828 KB
testcase_25 AC 35 ms
53,264 KB
testcase_26 AC 34 ms
52,752 KB
testcase_27 AC 36 ms
52,828 KB
testcase_28 AC 36 ms
53,064 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 0
    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