We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28f14ad commit 77f6e81Copy full SHA for 77f6e81
1 file changed
Problems/Mathematics/Day-01/sol/Hardik Singh Rana/Solution2.cpp
@@ -16,7 +16,14 @@ using namespace std;
16
17
const ll MOD = 1e9+7;
18
const ll INF = 1e18;
19
+/*
20
+We need to count the no of pairs such that their product makes some number's k-th power-this means the product of the two numbers should have
21
+factors frequency that is divisible by k. For every number first factorize it using spf(also store its factors mod k) and also store how much
22
+factor more it needs to make the k-th power add this for all numbers.
23
24
+*/
25
+
26
+/* Submission Link: https://codeforces.com/contest/1225/submission/355183203 */
27
void solve() {
28
int n,k;
29
cin>>n>>k;
@@ -68,4 +75,4 @@ int main() {
68
75
//cin >> t;
69
76
while(t--) solve();
70
77
return 0;
71
-}
78
+}
0 commit comments