11610 - Reverse Prime

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

Moderator: Board moderators

Post Reply
saiful_sust
Learning poster
Posts: 97
Joined: Fri Aug 22, 2008 10:18 pm
Location: CSE.SUST.SYLHET

11610 - Reverse Prime

Post by saiful_sust »


I Try to solve that problem BUT I get WA!!!!!!!!!!!!!!!
PL help me........ :oops: :oops: :oops: :oops: :oops:

Code: Select all

CUT............................
Last edited by saiful_sust on Sat May 30, 2009 12:18 pm, edited 1 time in total.

roticv
Learning poster
Posts: 63
Joined: Sat Dec 11, 2004 9:28 am

Re: 11610 - Reverse Prime

Post by roticv »

You didn't comment out your freopen. I think your code might TLE.

saiful_sust
Learning poster
Posts: 97
Joined: Fri Aug 22, 2008 10:18 pm
Location: CSE.SUST.SYLHET

Re: 11610 - Reverse Prime

Post by saiful_sust »

Thanks roticv....
for ur help.....
Now i have to read about BIT 8)

Igor9669
Learning poster
Posts: 85
Joined: Sun Jun 08, 2008 12:58 pm

Re: 11610 - Reverse Prime

Post by Igor9669 »

Hi, could somebody help me? my solution got WA ((

Code: Select all

///CUT......
Last edited by Igor9669 on Tue Aug 11, 2009 9:02 pm, edited 1 time in total.

hyperion
New poster
Posts: 8
Joined: Sun Aug 07, 2005 2:21 pm

Re: 11610 - Reverse Prime

Post by hyperion »

Hi Igor9669,

I think you assumed that deletion commands are given in ascending order and your program fails when deletion commands are given out of order..

try this input:
q 0
q 1
q 2
d 1000240
d 1000070
d 1000090
q 0
q 1

the correct output for the input above is:
4
10
16
3
7

Igor9669
Learning poster
Posts: 85
Joined: Sun Jun 08, 2008 12:58 pm

Re: 11610 - Reverse Prime

Post by Igor9669 »

Thanks for your test it really help me to find a bug and to correct my solution! :D

mpi
New poster
Posts: 46
Joined: Fri Nov 03, 2006 7:53 pm
Location: Madrid

Re: 11610 - Reverse Prime

Post by mpi »

There's something weird about this problem. After getting WA I went to the UVA toolkit site and checked several queries to see what my mistake was. This is what I found:

Input:

Code: Select all

q 39283
q 39284
My output:

Code: Select all

200580
200584
UVA Toolkit output:

Code: Select all

200580
200593
It turns out that reversed prime no. 39283 is 7000000 which has 13 prime factors and if I add 7000000 twice to the set... everything is OK :o
Anyone can explain this? Is there any reversed prime between 7000000 (39283) and 7000030 (39284) that I'm not aware of?

zobayer
Experienced poster
Posts: 110
Joined: Tue May 06, 2008 2:18 pm
Location: CSE-DU, Bangladesh
Contact:

Re: 11610 - Reverse Prime

Post by zobayer »

Haven't solve that yet, but just want to say, uva toolkit is not much reliable for testing.
You should not always say what you know, but you should always know what you say.

Post Reply

Return to “Volume 116 (11600-11699)”