結果

問題 No.1882 Areas of Triangle
ユーザー lloyzlloyz
提出日時 2022-03-25 00:47:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 81,964 KB
実行使用メモリ 91,084 KB
最終ジャッジ日時 2024-04-21 09:22:52
合計ジャッジ時間 3,100 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,172 KB
testcase_01 AC 40 ms
52,472 KB
testcase_02 AC 40 ms
52,504 KB
testcase_03 AC 40 ms
51,972 KB
testcase_04 AC 128 ms
89,268 KB
testcase_05 AC 126 ms
91,084 KB
testcase_06 AC 95 ms
90,408 KB
testcase_07 AC 41 ms
51,768 KB
testcase_08 AC 39 ms
51,908 KB
testcase_09 AC 40 ms
52,124 KB
testcase_10 AC 40 ms
51,656 KB
testcase_11 AC 40 ms
51,648 KB
testcase_12 AC 40 ms
51,948 KB
testcase_13 AC 40 ms
52,532 KB
testcase_14 AC 40 ms
51,772 KB
testcase_15 AC 40 ms
51,824 KB
testcase_16 AC 48 ms
59,092 KB
testcase_17 AC 55 ms
62,516 KB
testcase_18 AC 57 ms
64,728 KB
testcase_19 AC 63 ms
71,400 KB
testcase_20 AC 69 ms
71,852 KB
testcase_21 AC 64 ms
70,152 KB
testcase_22 AC 70 ms
73,148 KB
testcase_23 AC 85 ms
78,472 KB
testcase_24 AC 82 ms
78,288 KB
testcase_25 AC 40 ms
52,308 KB
testcase_26 AC 38 ms
51,800 KB
testcase_27 AC 39 ms
52,036 KB
testcase_28 AC 38 ms
52,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

n, k = map(int, input().split())
k *= 2
A = list(map(int, input().split()))
A.sort()

ans = 0
for i in range(n):
    res = (k + A[i] - 1) // A[i]
    idx = bisect_left(A, res)
    ans += n - idx
print(ans)
0