with bitset<2001> bits[1000][1000];
what time complexity of operation shifting ( =<< or =>> ) !!
and what is Memory ?
# | User | Rating |
---|---|---|
1 | jiangly | 4039 |
2 | tourist | 3841 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3590 |
5 | ecnerwala | 3542 |
6 | Benq | 3535 |
7 | orzdevinwang | 3526 |
8 | gamegame | 3477 |
9 | heuristica | 3357 |
10 | Radewoosh | 3355 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | atcoder_official | 160 |
3 | Um_nik | 160 |
5 | djm03178 | 158 |
6 | Dominater069 | 156 |
7 | adamant | 153 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 147 |
Name |
---|
Standard doesn't says anything about it, but I think it's safe to assume, that bitsets inside just static array of unsigned numbers. So shifting must be just loop over that array. So complexity would be
O(N / bits_per_number)
. And what memory you are asking?so time complexity this operation bits[ 1 ][1] |= ( bits[ 0 ][0] >> 1 ) take O( 1 ) !
O(1)
with big constant (if bitset stores 32bit numbers that it would beceil(2001 / 32) = 66
)