Hey everyone! I am getting "Time limit exceeded" prompt on a fairly easy question. Here's my code: https://codeforces.com/problemset/submission/1520/115570147. Can somebody point out why is my code exceeding the time limit with suitable corrections? Thanks in advance!
First of all $$$n \le 10^9$$$. And you are looping from $$$1$$$ to $$$10^9$$$. This is already $$$10^9$$$ operations which is already too much. You have to do something smarter then this naive bruteforce.