Different summation
CodeChefOpen on judge ↗
You have an array Arr of N numbers ranging from 0 to 9999. Also you have Q queries [L, R]. For each such query you must print V([L, R]) = ∑i=0...9999 count(i)^2 where i is a multiple of 5 and count(i) is the number of times i occurs in Arr[L..R]. Input The first line of input contains 2 integers. n q n: Number of elements q: Number of queries The second line contains an array of n number
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