結果

問題 No.794 チーム戦 (2)
ユーザー convexineqconvexineq
提出日時 2021-03-18 04:02:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 1,500 ms
コード長 241 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 110,208 KB
最終ジャッジ日時 2024-04-27 17:41:48
合計ジャッジ時間 5,016 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,840 KB
testcase_01 AC 35 ms
52,352 KB
testcase_02 AC 35 ms
51,712 KB
testcase_03 AC 34 ms
52,096 KB
testcase_04 AC 37 ms
51,840 KB
testcase_05 AC 36 ms
52,096 KB
testcase_06 AC 36 ms
51,840 KB
testcase_07 AC 39 ms
51,584 KB
testcase_08 AC 35 ms
52,352 KB
testcase_09 AC 34 ms
51,968 KB
testcase_10 AC 34 ms
51,712 KB
testcase_11 AC 33 ms
51,840 KB
testcase_12 AC 36 ms
51,840 KB
testcase_13 AC 36 ms
51,712 KB
testcase_14 AC 144 ms
105,796 KB
testcase_15 AC 145 ms
105,556 KB
testcase_16 AC 151 ms
105,652 KB
testcase_17 AC 152 ms
105,148 KB
testcase_18 AC 141 ms
104,904 KB
testcase_19 AC 139 ms
105,380 KB
testcase_20 AC 136 ms
105,148 KB
testcase_21 AC 135 ms
105,416 KB
testcase_22 AC 113 ms
100,480 KB
testcase_23 AC 112 ms
97,280 KB
testcase_24 AC 98 ms
92,672 KB
testcase_25 AC 91 ms
88,904 KB
testcase_26 AC 86 ms
87,168 KB
testcase_27 AC 108 ms
110,056 KB
testcase_28 AC 108 ms
110,016 KB
testcase_29 AC 108 ms
110,208 KB
testcase_30 AC 108 ms
109,664 KB
testcase_31 AC 100 ms
107,264 KB
testcase_32 AC 99 ms
107,392 KB
testcase_33 AC 108 ms
109,852 KB
testcase_34 AC 110 ms
109,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
*a, = map(int,input().split())
a.sort()
MOD = 10**9+7
idx = 0
ans = 1
for i in range(n//2):
    while idx < n and a[n-1-i] + a[idx] <= k:
        idx += 1
    ans *= min(idx-i,n-1-i*2)
    ans %= MOD
print(ans)
0