Entries from 2016-09-05 to 1 day
Problem - E - Codeforces Seems like there were cases that deliberately hacked those who used only one MOD value for hashing, where such hack tests can easily be prepared with a little knowledge of birthday paradox. First, it might be a lit…
Problem - D - Codeforces I thought this resembled quite a lot with this problem. What we really have to do is to perform dynamic programming on: dp[ S ][ i ] : the value of having each element in set S eaten and i'th as the last int bit_co…
Problem - C - Codeforces Not much do I really need to mention. We will only have to traverse the graph with a single DFS. void dfs( const vvi &G, const vi &has_cat, int cat_cnt, int u, int fa, int &ans ){ if( has_cat[ u ] ) ++cat_cnt; // c…
Problem - B - Codeforces If the friends are sorted such that each of their money is in ascending order, any valid combinations, having maximised the largest value, will be a contiguous segment. Hence we will apply crawling technique to fin…