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

# | User | Rating |
---|---|---|

1 | tourist | 3851 |

2 | jiangly | 3634 |

3 | Um_nik | 3539 |

4 | slime | 3498 |

5 | ksun48 | 3493 |

6 | djq_cpp | 3486 |

7 | maroonrk | 3471 |

8 | Radewoosh | 3442 |

9 | Petr | 3426 |

10 | Isonan | 3344 |

# | User | Contrib. |
---|---|---|

1 | -is-this-fft- | 185 |

2 | awoo | 180 |

3 | dario2994 | 171 |

4 | SecondThread | 168 |

4 | maroonrk | 168 |

4 | Um_nik | 168 |

4 | adamant | 168 |

8 | YouKn0wWho | 166 |

8 | errorgorn | 166 |

10 | antontrygubO_o | 162 |

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

↑

↓

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/27/2022 20:27:53 (f1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

Or all elements

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.

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

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.

I think you want the solution or hints of this problem.