10590 - Boxes of Chocolates Again

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

Moderator: Board moderators

Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

Post by Per » Fri Jan 09, 2004 8:47 am

Yeah, that is correct.

Also: the output for 5000 is 169820168825442121851975101689306431361757683049829233322203824652329144349.

Alexander Kozlov
New poster
Posts: 23
Joined: Sun Jun 15, 2003 4:45 pm
Location: Ukraine

Post by Alexander Kozlov » Fri Jan 09, 2004 6:19 pm

Thank you Per!

My programs produces the same output for 5000, but I still get WA!
What can be the cause?

What about this one

INPUT

10
9
8
7
6
5
4
3
2
1
3234
423
567
123
23
34
76
34
87
324
1969
4999

OUTPUT

42
30
22
15
11
7
5
3
2
1
99538594492809222469473074667593323441246751999382660193320
27253164546230421739
83983162210640880002321
2552338241
1255
12310
9289091
12310
38887673
49005643635237875
1964061380567012302624155966071951926644451875
166800841969169335828987218802327547808425240948910985503607178177016413875

HELP, please!

Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

Post by Per » Fri Jan 09, 2004 6:29 pm

Those outputs are correct as well. That's strange, it's not like there are any particularly "tricky" inputs... If you want, I can look at your code and try to see what is wrong. Just send me a PM.

User avatar
shamim
A great helper
Posts: 498
Joined: Mon Dec 30, 2002 10:10 am
Location: Bozeman, Montana, USA

Post by shamim » Sat Jan 10, 2004 10:28 am

What about 0,
the answer should be 1 :wink:

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski » Mon Jan 12, 2004 9:56 am

The problem says that number should be positive so zero is bad input ;-)
Try to find if you have leading zeroes in answer - that's incorrect (I made such mistake first time :( )

Best regards
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)

Alexander Kozlov
New poster
Posts: 23
Joined: Sun Jun 15, 2003 4:45 pm
Location: Ukraine

Post by Alexander Kozlov » Mon Jan 12, 2004 12:31 pm

Dear friends!

I got AC. The error was in long arithmetics.

My program outputs 1 for input 0.

Regards!

Post Reply

Return to “Volume 105 (10500-10599)”