kamyu104/MetaHackerCup-2022

lemonade_life_input

Closed this issue · 2 comments

I think you are losing some performance here using (a-b)**2 rather than writing (a-b)*(a-b)

https://github.com/kamyu104/MetaHackerCup-2022/blob/main/Round%201/lemonade_life.py3#L53

Also, I'm curious, what was your runtime on your local computer? I ran your code in pypy and it finished in 6 minutes and 30 seconds.

  1. I don't optimize it since it didn't help on my local computer.
  2. I ran my code in PyPy v7.3.7 and finished in 273.23s (~4.7 minutes) on Macbook Pro (2GHz, 4Cores, Intel Core i5).