結果

問題 No.794 チーム戦 (2)
ユーザー rlangevinrlangevin
提出日時 2023-09-27 00:36:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 193 ms / 1,500 ms
コード長 250 bytes
コンパイル時間 1,118 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 106,736 KB
最終ジャッジ日時 2023-09-27 00:36:17
合計ジャッジ時間 8,478 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,316 KB
testcase_01 AC 71 ms
71,064 KB
testcase_02 AC 69 ms
71,284 KB
testcase_03 AC 70 ms
71,308 KB
testcase_04 AC 70 ms
71,108 KB
testcase_05 AC 71 ms
71,136 KB
testcase_06 AC 70 ms
70,788 KB
testcase_07 AC 69 ms
71,104 KB
testcase_08 AC 69 ms
71,276 KB
testcase_09 AC 70 ms
71,356 KB
testcase_10 AC 69 ms
70,988 KB
testcase_11 AC 70 ms
71,276 KB
testcase_12 AC 68 ms
71,044 KB
testcase_13 AC 71 ms
71,320 KB
testcase_14 AC 191 ms
101,908 KB
testcase_15 AC 190 ms
102,224 KB
testcase_16 AC 190 ms
102,020 KB
testcase_17 AC 193 ms
101,644 KB
testcase_18 AC 172 ms
101,896 KB
testcase_19 AC 174 ms
101,976 KB
testcase_20 AC 172 ms
101,776 KB
testcase_21 AC 172 ms
102,096 KB
testcase_22 AC 148 ms
96,168 KB
testcase_23 AC 141 ms
94,244 KB
testcase_24 AC 122 ms
90,168 KB
testcase_25 AC 121 ms
87,148 KB
testcase_26 AC 126 ms
88,404 KB
testcase_27 AC 158 ms
106,736 KB
testcase_28 AC 155 ms
106,680 KB
testcase_29 AC 156 ms
106,568 KB
testcase_30 AC 150 ms
106,160 KB
testcase_31 AC 138 ms
106,300 KB
testcase_32 AC 138 ms
105,940 KB
testcase_33 AC 160 ms
106,432 KB
testcase_34 AC 161 ms
106,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
mod = 10**9 + 7
ans = 1
for i in range(N//2):
    ind = bisect_right(A, K - A[-1-i])
    ans *= min(N - 1 - i, ind) - i
    ans %= mod
    
print(ans)
0