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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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)”