## 10235 - Simply Emirp

Moderator: Board moderators

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

### 10235 why not AC?

Plz any one help me!

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?

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?

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

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

### 10235 - Simply Emirp WA

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

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

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

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

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

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

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

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

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

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

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

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