سؤال

A sequence is good if the bitwise AND of all its elements is a perfect square.

So counting number of "good" sequences, in a subarray .
For example : in [1, 2, 3]
There are 6 sub-sequences:

enter image description here

So there are 3 "good" sequences
Can you suggest an efficient approach to count them ?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى cs.stackexchange
scroll top