10235 - Simply Emirp

All about problems in Volume 102. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

cse.mehedi
New poster
Posts: 36
Joined: Sun Mar 18, 2012 8:18 am

10235 why not AC?

Post by cse.mehedi » Fri Mar 23, 2012 10:31 pm

Plz any one help me!
:( :( :oops:

Code: Select all

Removed after AC
Last edited by cse.mehedi on Wed Mar 28, 2012 3:53 am, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10235 why not AC?

Post by brianfry713 » Wed Mar 28, 2012 12:06 am

101 is prime, not emirp, it has to be a different prime after reversal.
Check input and AC output for thousands of problems on uDebug!

cse.mehedi
New poster
Posts: 36
Joined: Sun Mar 18, 2012 8:18 am

Re: 10235 why not AC?

Post by cse.mehedi » Wed Mar 28, 2012 3:55 am

brianfry713 wrote:101 is prime, not emirp, it has to be a different prime after reversal.
Thank u!!!!!!!!! :D

starain
New poster
Posts: 4
Joined: Thu Nov 15, 2012 10:49 pm

10235 - Simply Emirp WA

Post by starain » Thu Nov 15, 2012 11:07 pm

Remove after accepted
Last edited by starain on Sat Nov 17, 2012 1:57 pm, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10235 - Simply Emirp WA

Post by brianfry713 » Sat Nov 17, 2012 5:02 am

change these lines:

Code: Select all

while(!cin.eof())
{
cin >>input;
to:

Code: Select all

while(cin >>input) {
Check input and AC output for thousands of problems on uDebug!

starain
New poster
Posts: 4
Joined: Thu Nov 15, 2012 10:49 pm

Re: 10235 - Simply Emirp WA

Post by starain » Sat Nov 17, 2012 1:59 pm

Can you please explain the reason.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10235 - Simply Emirp WA

Post by brianfry713 » Mon Nov 19, 2012 11:45 pm

There may be whitespace at the end of the last line. Usually there is at least a newline character at the end of every line, including the last one.
Check input and AC output for thousands of problems on uDebug!

sirajul
New poster
Posts: 6
Joined: Sat Mar 23, 2013 12:07 am

Re: WA in 10235

Post by sirajul » Sat Mar 23, 2013 3:27 am

Code: Select all

deleted after ac

moudud99
New poster
Posts: 28
Joined: Fri Feb 08, 2013 1:40 pm

Re:Ned some input for 10235

Post by moudud99 » Sat Aug 03, 2013 2:29 pm

Can anyone give some input?I can use them to find my mistake.

The-PHx
New poster
Posts: 6
Joined: Sat Sep 28, 2013 10:32 pm

Re: 10235 - Simply Emirp WA

Post by The-PHx » Tue Oct 15, 2013 10:55 pm

plz tell me how to optimize this solution cause it's getting TL

Code: Select all

deleted
Last edited by The-PHx on Thu Oct 24, 2013 1:30 pm, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10235 - Simply Emirp WA

Post by brianfry713 » Wed Oct 16, 2013 8:30 pm

Precompute whether each possible input is prime or not.
Check input and AC output for thousands of problems on uDebug!

The-PHx
New poster
Posts: 6
Joined: Sat Sep 28, 2013 10:32 pm

Re: 10235 - Simply Emirp WA

Post by The-PHx » Thu Oct 17, 2013 3:12 pm

sorry I don't understand what should I do
I mean that the code is doing it right >> i think

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10235 - Simply Emirp WA

Post by brianfry713 » Thu Oct 17, 2013 7:53 pm

Before you read any input compute whether each possible N is prime.
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
Check input and AC output for thousands of problems on uDebug!

The-PHx
New poster
Posts: 6
Joined: Sat Sep 28, 2013 10:32 pm

Re: 10235 - Simply Emirp WA

Post by The-PHx » Thu Oct 24, 2013 1:32 pm

thanks for the great help
I think it's clear now

jokerz
New poster
Posts: 8
Joined: Tue Nov 05, 2013 10:24 am

simply emrip 10235

Post by jokerz » Tue Nov 05, 2013 10:52 am

I don't know why i am getting WA :roll: WA :roll: ...please anyone help me....
Here is the link of my code:
http://ideone.com/NeMde2

Post Reply

Return to “Volume 102 (10200-10299)”