Comments

Here is an alternative solution for problem G2 (Python): https://codeforces.me/contest/1791/submission/192216076

It is quite fast and in my opinion easier and faster than the original solution.

Obviously it is still nlog(n) because of the sort.

Very true. Thank you for you helpful answer!

I think because of the:

"if sum(cc) == k:"

you will only get a time complexity of 252 * n. ( 10!/(5!*5!) = 252 )

Great problems. Really enjoyed the round despite struggling with B for way too long.

How can this solution still be too slow for Test #30 in problem C? (PyPy 3) Any way I can write the for-loop faster.

https://codeforces.me/contest/1778/submission/191729330

Thanks!

Can someone explain Problem F1 in Python: Basically I created a 200.000 long list where the number in the list is the amount of pigs and the index is the hp — 1.

I tried:

if art == 1:
    new_spawn[hp - 1] += 1
if art == 2:
    new_spawn = new_spawn[hp:] + [0] * hp
    hp_kill += hp
if art == 3:
    for i in range(200000 - hp_kill):
        new_spawn[i] += new_spawn[hp_kill + i]
    hp_kill = 2 * hp_kill

which gave me a TLE and:

if art == 3:
    new_spawn = list(map(add, new_spawn[hp_kill:] + [0] * hp_kill, new_spawn))

which gave me a MLE.

I am new to codeforces and hence don't even know the basics :(.

Thank you very much. It was a fun round.

Thank you :)

Can this idea work or is just way too slow even with a better implementation? (Problem C):

https://codeforces.me/contest/1771/submission/184805467