Please read the new rule regarding the restriction on the use of AI tools. ×
Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Zenith_053's blog

By Zenith_053, history, 14 months ago, In English

I don't understand why my code is giving TLE. It would be great if someone helps me out, I am really stuck in this question.

QUESTION SOLUTION

As for reference this code has been accepted REf. Code

Tags tle
  • Vote: I like it
  • -5
  • Vote: I do not like it

| Write comment?
»
14 months ago, # |
  Vote: I like it +12 Vote: I do not like it

Use long long i=2;i*i<=q;i++ to avoid overflow.