CF #428

Codeforces Round #428 Div.2 D - Winter is here

http://codeforces.com/contest/839/problem/D 問題概要 N要素の数列Aが与えられる。Aの部分集合Sに対して、strength(S) = |S|・gcd(S) と定義する。gcd(S) > 1 なるすべての部分集合Sに対するstrengthの総和を求めよ。 N <= 2 * 105, max(A) <= 106 解法 一…