結果

問題 No.794 チーム戦 (2)
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-22 01:00:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 191 ms / 1,500 ms
コード長 268 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 106,772 KB
最終ジャッジ日時 2023-08-26 16:24:41
合計ジャッジ時間 6,992 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,288 KB
testcase_01 AC 68 ms
71,532 KB
testcase_02 AC 68 ms
71,364 KB
testcase_03 AC 69 ms
71,604 KB
testcase_04 AC 67 ms
71,456 KB
testcase_05 AC 71 ms
71,408 KB
testcase_06 AC 70 ms
71,508 KB
testcase_07 AC 69 ms
71,328 KB
testcase_08 AC 70 ms
71,344 KB
testcase_09 AC 70 ms
71,460 KB
testcase_10 AC 71 ms
71,372 KB
testcase_11 AC 72 ms
71,304 KB
testcase_12 AC 72 ms
71,188 KB
testcase_13 AC 70 ms
71,296 KB
testcase_14 AC 191 ms
102,416 KB
testcase_15 AC 191 ms
102,696 KB
testcase_16 AC 191 ms
102,344 KB
testcase_17 AC 189 ms
102,056 KB
testcase_18 AC 170 ms
102,104 KB
testcase_19 AC 171 ms
102,064 KB
testcase_20 AC 170 ms
102,068 KB
testcase_21 AC 171 ms
102,260 KB
testcase_22 AC 147 ms
96,240 KB
testcase_23 AC 138 ms
94,440 KB
testcase_24 AC 117 ms
90,576 KB
testcase_25 AC 118 ms
87,568 KB
testcase_26 AC 124 ms
88,872 KB
testcase_27 AC 154 ms
106,696 KB
testcase_28 AC 160 ms
106,108 KB
testcase_29 AC 154 ms
106,772 KB
testcase_30 AC 151 ms
106,388 KB
testcase_31 AC 141 ms
106,724 KB
testcase_32 AC 142 ms
106,180 KB
testcase_33 AC 160 ms
106,292 KB
testcase_34 AC 151 ms
106,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
mod = 10 ** 9 + 7
N, K = map(int, input().split())
A = sorted(map(int, input().split()))

ans = 1
used = 0

for _ in range(N // 2):
    R = A.pop()
    i = bisect.bisect_right(A, K - R)
    ans *= max(0, i - used)
    ans %= mod
    used += 1

print(ans)
0