|
|
back to boardWA #5 I use priority queue,the memory that I used is 236 KB,but I still WA at test 5,but I don't know why... Re: WA #5 Posted by Міша 12 Jun 2014 23:40 You need use unsigned int. Re: WA #5 Posted by EGlym 18 Feb 2017 05:39 could someone tell me why ? Edited by author 18.02.2017 05:40 Edited by author 18.02.2017 05:40 Re: WA #5 2^31-1 can be stored into signed int. But, when length of input is even, you need to value average, so (probably) add 2 values and receive integer overflow. It doesn't mean you must use unsigned. You can avoid overflow in any other way. |
|
|