#P4317. 花神的数论题

    ID: 3250 远端评测题 1000ms 125MiB 尝试: 1 已通过: 1 难度: 7 上传者: 标签>枚举,暴力数位 dp进制概率论,统计

花神的数论题

Description

One day, Huashen came to give another lecture. As usual, there was a super hard problem afterwards... We weaklings suffered again. The problem is as follows: Let sum(i)\text{sum}(i) denote the number of 11 s in the binary representation of ii. Given a positive integer NN, Huashen asks you to compute i=1Nsum(i)\prod_{i=1}^{N}\text{sum}(i), that is, the product of sum(1)sum(N)\text{sum}(1)\sim\text{sum}(N).

Input Format

A positive integer NN.

Output Format

One integer: the answer modulo 1000000710000007.

3
2

Hint

Constraints: For 100%100\% of the testdata, 1N10151 \le N \le 10^{15}.

Translated by ChatGPT 5