omarsaifeldeen2000's blog

By omarsaifeldeen2000, history, 4 days ago, In English

This is my first blog ( Hopefully not the last :D )

I came across this problem in a group contest that no one could solve (I couldn't solve it either, so i need help) basically all the problem is just given an positive integer n (1 <= n <= 1e5) and array a, your task is to find the number of pairs i, j (1 <= i < j <= n) such that a[i] | a[j] = a[i] or a[i] | a[j] = a[j]. Yes, that's it.

I'd be really grateful for any help. Thanks for your time.

Full text and comments »

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