bicolored专题

ural Bicolored Horses(二维dp)

http://acm.timus.ru/problem.aspx?space=1&num=1167 有n个马,黑白两种,依次放入k个马厩,将x匹马放在一个马厩的不快乐值为黑马数目*白马数目。问最后的不快乐值最小是多少? 设dp[i][j]表示前i个马厩放了j匹马的最小不快乐值,那么dp[i][j] = min(dp[i-1][g]+tmp[g+1][j])。 其中tmp是预处理的

cf Educational Codeforces Round 65 D. Bicolored RBS

原题: D. Bicolored RBS time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A string is called bracket sequence if it does not contain any chara