結果

問題 No.645 Count Permutation
ユーザー maspymaspy
提出日時 2020-05-01 18:25:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 44,584 KB
最終ジャッジ日時 2024-12-24 13:30:17
合計ジャッジ時間 27,024 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 7
権限があれば一括ダウンロードができます

ソースコード

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