760. Sum over Bitwise Operators

Define

g(m,n)=(mn)+(mn)+(mn)

where ,, are the bitwise XOR, OR and AND operator respectively. Also set

G(N)=n=0Nk=0ng(k,nk)

For example, G(10)=754 and G(102)=583766.

Find G(1018). Give your answer modulo 1000000007.

760. 位运算求和

g(m,n)=(mn)+(mn)+(mn)

其中 ,, 分别指按位异或、按位或、按位与运算。

另记

G(N)=n=0Nk=0ng(k,nk)

例如有 G(10)=754G(102)=583766

G(1018)1000000007 的值。


这个链接 回到源站。

这个链接 回到详细版题目目录。