Problem link: SPOJ Problem Set (classical): 17707. Constructible Regular Polygons

As stated in the problem description, you are required to utilize this page. As there are only 5 Fermat Primes, you can easily do a pre-processing up to 10^{6} in constant time (2^{5}×5) and answer each query in O(1).

Good approach.

ReplyDelete