|
|
Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | What is test 7? | So Sui Ming | 2123. Рюкзак | 8 янв 2024 08:09 | 1 | WA on test 7. I've used uint64_t in array and sum, and int64_t in result. Corner case of sum = 0 is taken care of. Regards, So Sui Ming | hint | ironchat(ITMO) | 2123. Рюкзак | 13 авг 2022 10:27 | 2 | hint ironchat(ITMO) 9 авг 2019 16:39 Simple solution, but try to optimize it! If you want better explanation (myironmistake@gmail.com) Simple recursion from highest weight down to lowest with proper cut-off on maximal reachable weight and caching of results gives AC in 0.015 sec and 1Mb RAM. I write that spoiler here because I suspects that tests are very weak because I have no proof of why this straightforward thing works so fast when problem has 4-sec/256Mb limits. | WA34 | Zergatul | 2123. Рюкзак | 25 окт 2020 02:21 | 1 | WA34 Zergatul 25 окт 2020 02:21 Use 64 bit integer for resulting value. Initially I didn't believe result can be this big and spent a lot of time looking for another possible issues with code. |
|
|
|