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
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
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
Название |
---|
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.