Ya,I did not. That’s why its O((n+m)(\sqrt(a_i) +log^2(a_i)))
I factorised a_i, then i kept all the factors in a vector. I paired the factors together, and use an array to store the used factors to prevent recounting before checking in the array, I check whether its lesser than 10^5. At the time I did not know how to use recursion to do that. So afterwards this comes out to be approximately log^2 a_i. The factors are also double counted very often.
Will the factors of y and y^2 ( such that it is <= y ) be same ??
https://www.codechef.com/viewsolution/29545814
Can you please tell me what is wrong in my implementation ??
https://www.codechef.com/viewsolution/29545814
Can you please tell me what is wrong in my implementation?