Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready for the attack of the White Walkers. He has created a m…
D. Winter is here time limit per test:3 seconds memory limit per test:256 megabytes input:standard input output:standard output Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the res…
给你一个序列,让你对于所有gcd不为1的子序列,计算它们的gcd*其元素个数之和. 设sum(i)为i的倍数的数的个数,可以通过容斥算出来. 具体看这个吧:http://blog.csdn.net/jaihk662/article/details/77161436. 注意1*C(n,1)+2*C(n,2)+...+n*C(n,n)=n*2^(n-1). #include<cstdio> using namespace std; typedef long long ll; #define MOD…