### Random Post

### Recent Posts

- Puzzle 69: Division: letters for digits
- Enigma 1106: Not a square unused
- Enigma 405: Uncle bungles the answer
- Enigma 401: Uncle bungles the answer
- Puzzle 70: Football five teams: new method
- Enigma 1107: Factory work
- Enigma 404: Regular timepiece
- Tantalizer 477: Precognition
- Enigma 1108: Every vote counts
- Enigma 403: Taking stock

### Recent Comments

saracogluahmet on Enigma 1740: Sudoprime | |

Jim Randell on Enigma 1740: Sudoprime | |

geoffrounce on Enigma 1740: Sudoprime | |

geoffrounce on Enigma 1730: Prime positi… | |

Jim Randell on Enigma 389: Missing, presumed… |

### Archives

### Categories

- article (11)
- enigma (1,087)
- misc (2)
- project euler (2)
- puzzle (23)
- site news (42)
- tantalizer (23)
- teaser (3)

### Site Stats

- 159,091 hits

The following Python code runs in 32ms.

Solution:The first polygon has 9 sides. The second polygon polygon has 40 sides.I know it hardly matters in such a small case as this, but once you’ve determined X, you don’t need a loop to determine Y. As XY = 360 you can do it much more efficiently in one step:

Thanks for the hint.

By using divmod, 0.0003793778259527398 seconds process time,

reduced to 0.00030953654724273616 seconds process time, without Y loop.