結果

問題 No.794 チーム戦 (2)
ユーザー stngstng
提出日時 2022-06-26 18:16:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 1,500 ms
コード長 343 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 96,468 KB
最終ジャッジ日時 2024-04-28 13:14:20
合計ジャッジ時間 5,163 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,272 KB
testcase_01 AC 34 ms
52,900 KB
testcase_02 AC 33 ms
52,632 KB
testcase_03 AC 36 ms
53,084 KB
testcase_04 AC 32 ms
53,160 KB
testcase_05 AC 33 ms
52,124 KB
testcase_06 AC 34 ms
52,000 KB
testcase_07 AC 33 ms
53,256 KB
testcase_08 AC 32 ms
53,180 KB
testcase_09 AC 33 ms
53,540 KB
testcase_10 AC 33 ms
53,548 KB
testcase_11 AC 34 ms
52,824 KB
testcase_12 AC 34 ms
53,972 KB
testcase_13 AC 33 ms
53,104 KB
testcase_14 AC 138 ms
96,356 KB
testcase_15 AC 142 ms
96,468 KB
testcase_16 AC 137 ms
95,860 KB
testcase_17 AC 142 ms
96,232 KB
testcase_18 AC 122 ms
96,036 KB
testcase_19 AC 120 ms
96,292 KB
testcase_20 AC 127 ms
96,232 KB
testcase_21 AC 120 ms
96,040 KB
testcase_22 AC 105 ms
88,728 KB
testcase_23 AC 98 ms
87,304 KB
testcase_24 AC 81 ms
84,740 KB
testcase_25 AC 85 ms
82,328 KB
testcase_26 AC 90 ms
83,304 KB
testcase_27 AC 112 ms
93,296 KB
testcase_28 AC 112 ms
93,144 KB
testcase_29 AC 108 ms
93,304 KB
testcase_30 AC 107 ms
92,968 KB
testcase_31 AC 99 ms
93,232 KB
testcase_32 AC 100 ms
92,760 KB
testcase_33 AC 114 ms
93,112 KB
testcase_34 AC 114 ms
93,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

a.sort()
ans = 1
mod = 10**9+7
cnt = 0

for i in range(n-1,0,-1):
    if i == n//2-1:
        break
    #print(i)
    val = k-a[i]
    idx = bisect.bisect_right(a,val)
    ans *= min(i,idx)-cnt
    ans %= mod
    #print(ans,i,idx-cnt)
    cnt += 1

print(ans)
0