I got this video recommended on google search for solution to this problem, and OH MY GOD!!! THANK YOU SO MUCH!!! You gave such detailed explanation, even the little things that people miss on, like even mentioning the exponent laws, such videos are very helpful for people dumb like me! Please keep continuing with such teaching style. I'm subscribed!!!!
i didnt understand the logic behind using a loop for looking for positionOfOddExponent as the last odd exponent in the vector will overwrite all the previous odd exponent. Like why dont you break upon getting the first oddExponent
@@iamanonymous5572 i am so sorry, i totally misunderstood what you were saying and what i said is totally wrong. i referred you to that problem because we proved that a^(p-1)=1 mod p and in this problem we indeed have a different form from the one in the other problem. Here we have (a^b)^c which is equal to a^(b*c) as you said. so in this problem, the product b*c can be very large so we use the theorem to calculate the product mod (p-1) and without this we wont be able to calculate it. and something slightly different was going on with the other problem, we couldnt calculate b^c so we needed to use the same reduction and calculated b^c mod p-1 using binary exponentiation. I apologize again for my previous comment.
1:38 - Number of Divisors
6:54 - Sum of Divisors
13:04 - Product of Divisors
I got this video recommended on google search for solution to this problem, and OH MY GOD!!! THANK YOU SO MUCH!!! You gave such detailed explanation, even the little things that people miss on, like even mentioning the exponent laws, such videos are very helpful for people dumb like me! Please keep continuing with such teaching style. I'm subscribed!!!!
Good explanation! Not only the formula but also details on how to work out them.
Thank you!
thank you sir, i will revisit this problem again
you are very welcome!
Arey look who is here XD
@@ayushxshukla haha, nice meeting u here bro. :)
i didnt understand the logic behind using a loop for looking for positionOfOddExponent as the last odd exponent in the vector will overwrite all the previous odd exponent. Like why dont you break upon getting the first oddExponent
Isn't product of divisor logic n^2? I am getting TLE on a test case
As you saw in the video! this approach got accepted! can you share your submission?
I didn't understand why we use (mod-1) for calculating outerexp. Please explain me in brief :)
It is due to fermat little theorem. To understand it better, i invite you to watch this video: ruclips.net/video/jkZ6c-uAl7Y/видео.html
@@neatlystructured that problem is a^b^c. But here we use (a^b)^c, isn't it? Correct me if I'm wrong.
@@iamanonymous5572 those two formulae are equal: a^b^c = (a^b)^c
@@neatlystructured (a^b) ^c=a^bc isn't it? Like (5^2)^3=5^2*3=5^6 and 5^2^3=5^8 am I correct?
@@iamanonymous5572 i am so sorry, i totally misunderstood what you were saying and what i said is totally wrong. i referred you to that problem because we proved that a^(p-1)=1 mod p and in this problem we indeed have a different form from the one in the other problem. Here we have (a^b)^c which is equal to a^(b*c) as you said. so in this problem, the product b*c can be very large so we use the theorem to calculate the product mod (p-1) and without this we wont be able to calculate it. and something slightly different was going on with the other problem, we couldnt calculate b^c so we needed to use the same reduction and calculated b^c mod p-1 using binary exponentiation. I apologize again for my previous comment.
nice explaination
amazing job!
thank you sir
you are very welcome!