Another Few Randomization Problems
Difficulty Ratings Idea Creativity: 3/5(Some are pretty geniosity) Techniques Used: 2/5 Implementation : 2/5 So uh I'll continue the previous post and post a few more randomization problems. Task 5 Link CF 452F Solution Sweep from left to right, consider a bitmask of elements that has appeared already. If the current element is x, you want to check whether the first 2x-1 bits of the bitmask is a palindrome, which can be done by polynomial hashing. There is also an OP deterministic solution that I'm not going to describe. Task 6 Link Link in simplified chinese Simplified Statement You have $M$ bitmasks of size $M$. The ith bitmasks have all bits set 0 except the ith bit, which is set 1. You are going to create $N-M$ new bitmasks, which each bitmask is created by taking bitwise-or of two bitmasks that already existed before. For each of the $N$ bitmasks, output the nubmer of bits that is 1. Your solution would be judged as correct, if for at least $95\%$ of th