結果

問題 No.1882 Areas of Triangle
ユーザー matcharate12
提出日時 2022-03-20 12:57:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,061 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,680 KB
最終ジャッジ日時 2024-10-10 12:04:49
合計ジャッジ時間 5,668 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

cnt = 0;
for i in range(N):
    ok = N
    ng = -1
    while abs(ok-ng) > 1:
        mid = (ok+ng)//2
        if A[i]*A[mid] >= K*2:
            ok = mid
        else:
            ng = mid
    cnt += N-ok
print(cnt)
0