Is it possible?

Правка en1, от tautology, 2018-01-26 23:48:29

Given array of n non-negative integers and a positive integer k. Is is possible to count all pairs with bitwise-OR equals to k?. Time complexity should be better than O(n^2). More formally , count no. of distinct pairs (ai,aj) such that ai|aj==k.[Note: pairs (ai,aj) and (aj,ai) are same.] If this is possible in T(n)<O(n^2),then how? Constraints: 1<=n<=1000000, 0<=ai<=10000.

Теги #bitwiseor, #help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский tautology 2018-01-26 23:48:29 402 Initial revision (published)