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 | 3757 |

2 | jiangly | 3590 |

3 | ksun48 | 3582 |

4 | Um_nik | 3539 |

5 | maroonrk | 3533 |

6 | slime | 3498 |

7 | djq_cpp | 3486 |

8 | Radewoosh | 3442 |

9 | cnnfls_csy | 3427 |

10 | ko_osaga | 3355 |

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

1 | -is-this-fft- | 184 |

2 | awoo | 181 |

3 | dario2994 | 171 |

4 | maroonrk | 168 |

4 | SecondThread | 168 |

4 | Um_nik | 168 |

7 | adamant | 166 |

8 | YouKn0wWho | 165 |

8 | errorgorn | 165 |

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: Oct/06/2022 11:28:15 (i2).

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.