You are not logged in. Please login at to post your questions!


Getting TLE

I am getting TLE for the last sub task of this

I also have a couple of doubts.

1) If I am finding primes upto 10^3 or 10^4 I am getting WA for last two sub tasks. I think I should get AC for that.

2) If I replace all[j]<=arr[i] with all[j]*all[j]<=arr[i], I am getting WA for last two sub tasks. Shouldn't this be right? I mean shouldn't we check it up to square root of the number?

3) And finally, what can be done to improve my solution?

My solution

asked 26 Mar '15, 21:04

dragonemperor's gravatar image

accept rate: 10%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 26 Mar '15, 21:04

question was seen: 517 times

last updated: 26 Mar '15, 21:04