Problem: Prateek Loves Candy
Giving TLE, Please Tell the mistake?
i have many modification in your code
you can check them in modified Code
- use bool instead of int in p array
- use long long int instead of int
- also make size of array= 7400000
because The 500,000th prime is 7,368,787.
Modified Code
1 Like
Thank you so much for the help, It Worked