Why am I getting TLE here?
The problem is from last Div 2 contest.
Problem: https://codeforces.com/contest/2257/problem/D#
Solution: https://codeforces.com/contest/2257/submission/387559313
I am getting TLE on test case 8.
Basically finding factors = sqrt(n)
The query loop should be = q * log(factors(n))
Can someone check and tell me which line is causing TLE?
EDIT:
I found the issue. I was using 'int i' while checking for factors instead of 'long long i'.
As a result i*i was never able to reach n for the given constraint