Codeforces Round #589 (Div. 2) - C

Title effect: the representative set $ X $ $ prime factors of $ prime (x).

                  $ G (x, p) $ $ p ^ k $ representative of the maximum value, $ $ K is an integer, and may be $ X $ $ p ^ k $ divisible.

                  $ F (x, p) $ Representative (x, p) $ value for $ prime (x) of each $ X $ $ $ G in.

                  Now given $ x, n $ find $ f (x, 1) * f (x, 2) * ... * f (x, n) mod (10 ^ 9 + 7) $ value.

Thinking: qualitative factor decomposition for $ x $, considered separately for each $ prime (x) $ answers contribution, assuming that the current prime factors as $ p_i $, then the number has $ n $ $ n / p_i the number P_i $ $ $ may be divisible, after considering the case $ p_i ^ 2 $, and if less than n-$ $ he contribute to the answer, according to the above have found $ n / p_i ^ 2 $ numbers may be $ p_i ^ 2 $ divisible, but there are two duplicate numbers, need to be removed.

	for(int i = 1; i <= m; ++i)
	{
		ll t = n;
		while(t / p[i] != 0)
		{
			ll num = t / p[i];
			ans = ans * pow_mod(p[i], num, MOD) % MOD;
			t /= p[i];
		}
	}

  

Guess you like

Origin www.cnblogs.com/zssst/p/11610852.html
Recommended