### Random Post

### Recent Posts

- Enigma 426: Time and again
- Enigma 1084: 1-2-3 triangles
- Tantalizer 466: Diplomacy
- Tantalizer 467: Nine men went to mow
- Enigma 1085: Cut and run
- Enigma 425: Them thar’ Hills
- Puzzle 60: Uncle Bungle gets the last line wrong
- Enigma 1086: Stacking trays
- Enigma 424: A round of fractions
- Tantalizer 468: Shell fire

### Recent Comments

Brian Gladman on Enigma 426: Time and agai… | |

Jim Randell on Enigma 426: Time and agai… | |

Jim Randell on Enigma 1084: 1-2-3 triang… | |

Brian Gladman on Enigma 1084: 1-2-3 triang… | |

Jim Randell on Enigma 1084: 1-2-3 triang… |

### Archives

### Categories

- article (11)
- enigma (1,129)
- misc (2)
- project euler (2)
- puzzle (32)
- site news (43)
- tantalizer (34)
- teaser (3)

### Site Stats

- 169,972 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.