Pairwise AND sum
You are given a sequence of N integer numbers A. Calculate the sum of Ai AND Aj for all the pairs (i, j) where i . The AND operation is the Bitwise AND operation, defined as in here. Input The first line of input consists of the integer N. The second line contains N integer numbers - the sequence A. Output Output the answer to the problem on the first line of the output. Scoring Subtask 1
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