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

×

PRIME1-HELP

I'm just a newbie, Iwas solving PRIME1 and my solution is here. Please help me where I'm doing wrong.

Thank you in advance. :)

This question is marked "community wiki".

asked 26 Apr '15, 20:38

arpn's gravatar image

4★arpn
464416
accept rate: 29%

wikified 27 Apr '15, 10:11


You have a line in main() : if(temp==m) temp+=p;

This line is wrong. Change it to if(temp==p) temp+=p;

This is because if the present value if itself a prime, we need to print it.

link

answered 27 Apr '15, 09:23

dragonemperor's gravatar image

3★dragonemperor
89321134
accept rate: 10%

Thank you :). Thanks a lot. :)

(27 Apr '15, 10:10) arpn4★
toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×2,700
×1,056
×69

question asked: 26 Apr '15, 20:38

question was seen: 737 times

last updated: 27 Apr '15, 10:11