|
|
back to boardShow all messages Hide all messagesHelp me, please.. Thanks.. Because you passed 14 test with BigNum you is Ok therefore you have problem with logic of the task. In this situation simple but clever test may help and they easy to produce if having AC. Try the next: 15 1 -1 0 2 -2 0 3 -1 0 0 -3 -3 2 0 1 Ans=18 and this one: 11 -1 0 -1 0 -3 0 -1 0 0 0 -2 Ans=0 Edited by author 29.10.2007 22:39 I used big numbers only for printing answer. I like my solution :) Got WA14 too... But currently I use big numbers for temporary calculations. Got AC. The problem was with long arithmetics. I wrote it modulo 10000, and it started overflowing after squaring because number of digits also must be taken into consideration. After reverting to modulo 1000, it worked fine. Try test with 50000 of 3s, check if you do not get negatives in the answer. |
|
|