結果

問題 No.645 Count Permutation
コンテスト
ユーザー maspy
提出日時 2020-05-01 18:25:53
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 422 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 34,144 KB
最終ジャッジ日時 2026-10-07 07:46:39
合計ジャッジ時間 16,396 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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