11431 - Partitioning a Number

Moderator: Board moderators

mysword
New poster
Posts: 26
Joined: Sun Mar 06, 2005 8:52 am

11431 - Partitioning a Number

Anyone give me some I/O? I don't why got many WA.... Is there any tricky cases?

Thanks!

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Contact:
I don't want to give the testcase since it will give away the solutions.
There is a good chance that you're not generating the correct numbers n that gives f(n)>f(m) for all m<n.

Just write a bruteforce program that generates all n<=10^6 and compute f(n) to check.

mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

Re: 11431 - Partitioning a Number

I don't find any coz of getting WA.anyone please check my output for the following input...
Input:

Code: Select all

``````1000000000000000000
100000000000000000
100000000000000
888888888888888
54564645646464646
1025
65537
2121513121
100
1000545
11111111111111
454545645646545
0``````
My Output:

Code: Select all

``````Case 1: 2504730781961
Case 2: 591286729879
Case 3: 4807526976
Case 4: 20365011074
Case 5: 365435296162
Case 6: 89
Case 7: 1597
Case 8: 2178309
Case 9: 21
Case 10: 10946
Case 11: 969323029
Case 12: 12586269025``````

pineapple
Learning poster
Posts: 57
Joined: Fri Nov 03, 2006 3:33 pm

Re: 11431 - Partitioning a Number

My ac code gets same output for your input

mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

Re: 11431 - Partitioning a Number

Still getting WA.I also checked my program with an ineff BF program.Here is my code..

Code: Select all

``AC.......``
Last edited by mmonish on Wed Jun 11, 2008 5:53 pm, edited 1 time in total.

mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

Re: 11431 - Partitioning a Number

I dont even find the coz of getting WA..

sunny
Experienced poster
Posts: 124
Joined: Sun Sep 11, 2005 10:22 pm
Location: Civil-BUET

Re: 11431 - Partitioning a Number

Sometimes your code does not work for an input<=3.

mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

Re: 11431 - Partitioning a Number

Thx sunny..
some silly mistake in coding.