← All problemsSign in

Triplets

Problem description. Aditya is a very good mathematician he loves to play with numbers. His friend Aman has challenged him with a question. He has given a number n and asked how many ordered triplets (a,b,c) of non-negative integers are there such that a+b+c2 = n This time he is not getting any solution and he don't want to lose to Aman. So he asked you for the help.Can you tell him the answer

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