The Teacher
CodeChefOpen on judge ↗
Dan is a teacher at a school. His students adore him but they also make a lot of noise. Dan is fed up and devises a way to make the students quiet down. He goes out to the garden and collects N sticks. He gives each stick a serial number from 1 to N for convenience. Interestingly the length of each stick is equal to its serial number. Now he asks his students to find out the number of distinct tri
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.
Sign in to chat with the tutor and save your progress.
Sign in to start