|
|
back to boardPython3 TLE 4 test Posted by Desserg 12 Dec 2019 15:41 if test 50000 300 300 My solution takes about 1.9 seconds (time library). the test fails. almost all the time spent on summarizing lists: "ncalls tottime percall cumtime percall filename:lineno(function)" "99402 1.773 0.000 1.773 0.000 {built-in method builtins.sum}" Maybe there is a way to more quickly summarize than the built-in function "sum"? Edited by author 12.12.2019 15:42 Edited by author 12.12.2019 15:42 Edited by author 12.12.2019 15:42 Re: Python3 TLE 4 test You may recalculate total sum of list on every iteration, if that lists changes predictable for you. For example, if you shift you list to the left for one position, and add some other value, then you may substract that shifted value and add new one, thus you perform updation. |
|
|