Блог пользователя new9934

Автор new9934, история, 19 месяцев назад, По-английски

How can I find out bitwise OR of elements of all possible strictly increasing subsequences present in an array? i have to find out that subsequence also.

Constraints

1≤T≤ 10

1<=N<=10^4

0 ≤ arri ≤ 500

  • Проголосовать: нравится
  • -16
  • Проголосовать: не нравится

»
19 месяцев назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Or all elements

»
19 месяцев назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

That's not a "doubt", a doubt is when you are confused or unsure about something, this is just plain "solve this problem".

Also there is clearly something missing from the statement. What is "that" subsequence? My best guess is that what you actually want to know is the maximum OR of all possible increasing subsequences, but that is only a pretty far-fetched guess.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    ignore that second part, i want to store bitwise or of all increasing subsequence

    • »
      »
      »
      19 месяцев назад, # ^ |
        Проголосовать: нравится +8 Проголосовать: не нравится

      You can't (in reasonable time) store bitwise ORs of all increasing subsequences, there is an exponential number of them.

      I suggest you think and write very slowly, carefully and clearly what you actually need.