|
|
back to boardI use priority queue,the memory that I used is 236 KB,but I still WA at test 5,but I don't know why... You need use unsigned int. could someone tell me why ? Edited by author 18.02.2017 05:40 Edited by author 18.02.2017 05:40 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. |
|
|