← All problemsSign in

Factorial to Square

CodeChefRating 3399Open on judge ↗

Given a positive integer n, we want to remove some values between 1 and n such that the product of the remaining ones is a perfect square number (i.e. the product = x * x, for some integer x). Meanwhile, we also want to maximize the product. Therefore, we are interested in the number of ways to remove some values to achieve the maximum perfect square product. The answer may be very large, and ther

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start