It looks like Rust doesn't have bitset in its std. Is there any alternative?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
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://mirror.codeforces.com/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://mirror.codeforces.com/problemset/problem/1826/E. Well actually, it looks like some people got it accepted with a few weird optimizations.
1854B - Earn or Unlock
hey you 123gjweq2 iam talking