Krish and Containers
CodeChefOpen on judge ↗
Problem Description: Krish loves chocolates very much. He has N containers numbered from 1 to N.Everyday, he used to select two indices [l,r] and adds 1 chocolate to each box starting from l to r (both inclusive).He repeats the same activity for M days. After M days, he asked his friend Nakshatra Q queries. Each query can be described as: How many containers have atleast K chocolates. Help Naks
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