Hey guys
if anyone wanted a video editorial for today div2 problem C I made one and posted onto youtube
Thank you!
# | 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 |
Name |
---|
Can you explain a bit more about the (mex+1 < number of elements) in the array?
Thanks
Hey! so you can keep a list of what numbers you need to increase the mex and if you have just one more you need, you can change a number into the number you need and you are done right? for example 0 1 2 3 4 5 100 => you want MEX 6, you have 0-5 so all you need is 6, so change the 100 to 6
but that relies on you having something to change. for example 0 1 2 3 4 5 => you want MEX 6. You have 0-5 so all you need is 6, but you can't change anything else to get a 6 because that means you lose one of the 1-5.
So, you have to check whether you have sufficient number of elements to get your mex+1. If you have < k elements in an array, you can't have MEX of k. So, you need to check if the number of elements is > mex+1, otherwise you can't achieve mex + 1.
Hope this helps!