Entries from 2016-08-16 to 1 day
Problem - E - Codeforces It's instinctive to come up with timestamp and segment tree. Initially I thought it would be fine with sets to maintain the set of colours, but now it seems like it wouldn't work. Maybe it's because my segment tree…
Problem - D - Codeforces We can simply brute force for 0 and 1 swap, so let's think about 2 swaps. When 2 swaps are committed, and given that asum is the sum for all elements in a, same for bsum, swapping ( i, j ) in A with ( x, y ) in B, …