Whats the most optimal way to detect prime numbers from 2 to n?

Revision en1, by AlirezaBest, 2026-02-26 23:08:22

Hello..I was solving problems of cf round 1083 Div.2 and when i encountered problem B i was fighting with time limit error i used the famous O(sqrt(n)) algorithm to detect prime numbers..but is there an algorithm from better order or not?

Thank you for reading:)

Tags number theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English AlirezaBest 2026-02-26 23:08:22 328 Initial revision (published)