結果

問題 No.645 Count Permutation
ユーザー maspymaspy
提出日時 2020-05-01 18:25:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 50,552 KB
最終ジャッジ日時 2023-08-26 00:56:46
合計ジャッジ時間 14,811 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 288 ms
29,496 KB
testcase_01 WA -
testcase_02 AC 118 ms
29,676 KB
testcase_03 AC 115 ms
29,684 KB
testcase_04 WA -
testcase_05 AC 113 ms
29,616 KB
testcase_06 AC 116 ms
29,488 KB
testcase_07 AC 113 ms
29,612 KB
testcase_08 WA -
testcase_09 AC 116 ms
29,488 KB
testcase_10 AC 116 ms
29,728 KB
testcase_11 AC 166 ms
29,508 KB
testcase_12 AC 148 ms
29,616 KB
testcase_13 AC 160 ms
29,636 KB
testcase_14 AC 121 ms
29,512 KB
testcase_15 WA -
testcase_16 AC 293 ms
29,716 KB
testcase_17 AC 597 ms
29,532 KB
testcase_18 AC 262 ms
29,648 KB
testcase_19 AC 643 ms
29,720 KB
testcase_20 AC 630 ms
29,620 KB
testcase_21 WA -
testcase_22 AC 115 ms
29,724 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 370 ms
29,572 KB
testcase_26 AC 523 ms
29,616 KB
testcase_27 AC 341 ms
29,612 KB
testcase_28 AC 265 ms
29,496 KB
testcase_29 AC 508 ms
29,632 KB
testcase_30 AC 513 ms
29,620 KB
testcase_31 AC 532 ms
29,532 KB
testcase_32 AC 232 ms
29,580 KB
testcase_33 AC 239 ms
50,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

MOD = 10**9 + 7

N, L, R = map(int, read().split())

dp = np.zeros(60, np.int64)
dp[0] = 1
for n in range(N-1):
    newdp = dp * n
    newdp[1:] += dp[:-1]
    dp = newdp % MOD

answer = 0
for i in range(60):
    if L <= (1<<i)<= R:
        answer += dp[i]
answer %= MOD

print(answer)
0