It looks like Rust doesn't have bitset in its std. Is there any alternative?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | adamant | 157 |
6 | awoo | 157 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | djm03178 | 153 |
It looks like Rust doesn't have bitset in its std. Is there any alternative?
Name |
---|
Yes, you can write your own implementation.
Egor has a contest library which includes bitset. https://github.com/EgorKulikov/rust_algo/blob/master/algo_lib/src/collections/bit_set.rs
At a glance it's not exactly the same (e.g. size is set at runtime) but may be good for your purposes.
The rust king himself. Thanks broski. This might be a dumb question, but can I just copy-paste this into my code when I need to?
Codeforces and most other platforms allow you to copy code if it's public before the contest starts.
With this particular library, it can be tricky because files often import other files in the library. The author uses an automated tool to splice together a file for submission. So it would probably be best for you to prepare a working version beforehand (or learn to use the library+tool).
gotcha, thanks
I thought about bitset too, but in 3 months of solving ~2000-2400 problems, I haven't found a problem that you can't solve without it. The same with multiset.
Sounds like you're unfamiliar with https://codeforces.me/blog/entry/53168
bruh. you got me ;)
Oh yeah, I remember your blog. It inspired me to start solving hard problems. Unfortunately, it looks like this problem requires bitset: https://codeforces.me/problemset/problem/1826/E. Well actually, it looks like some people got it accepted with a few weird optimizations.
1854B - Заработать или разблокировать
hey you 123gjweq2 iam talking