SuryanshIITP's blog

By SuryanshIITP, history, 15 months ago, In English

Problem Description Given an array A of N integers. Two numbers B and C are said to form a special pair if 2 x (B|C) + (B^C) — (B & C) >= B+ C. Count the number of pairs (i, j) and such that A[i] and A[j] form a special pair. Note: The pair (i, j) is considered the same as (j, i) so count it only once. problem Constraints are standard N<=1e5 and A[i]<=2^30

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it