题目链接: D. Alyona and Strings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After returned from forest, Alyona started reading a book. She noticed strings s and t, lengths of which are n a…
Game with Strings 题意并不是在图上走,看了好久才看出来.. dp[ i ][ mask ]表示从 i 层开始走,起点有mask个, a的个数-b的个数的 最大值或者最小值. #include<bits/stdc++.h> #define LL long long #define LD long double #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL&g…
题目链接: http://www.codeforces.com/contest/476/problem/E E. Dreamoon and Strings time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining…
题目 Source http://codeforces.com/contest/467/problem/C Description The new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn't have enough money, so George was going to work as a programmer. Now he faced t…
题目链接: http://codeforces.com/contest/161/problem/D D. Distance in Tree time limit per test 3 secondsmemory limit per test 512 megabytes 问题描述 A tree is a connected graph that doesn't contain any cycles. The distance between two vertices of a tree is th…