time limit exceed

can any one help me to solve efficiently if i have nested loops and both goes upto N<=100000.
i am getting time limit exceed for this.thanks in advance

In 1 second you can only loop 1000000 times if it more than that it will give TLE…
try to optimize the code…

For more information about Time Limit refer link :- topcoder

how can i optimize the code.please help me.

Think and create a logic to not do rework or extra work…try if u can do use some mathematical formulaes to shorten your work…

Use Algorithm and tricks to optimize your code