
Wecallastring good,ifaftermergingalltheconsecutiveequalcharacters,theresultingstringispalindrome.Forexample,"aabba"isgood,becauseafterthemergingstepitwillbecome"aba".Givenastring,youhavetofindtwovalues:thenumberofgoodsubstringsofevenlength;thenumberofgoodsubstringsofoddlength.InputThefirstlineoftheinputcontainsasinglestringoflength n (1 ≤ n ≤ 105).Eachcharacterofthestringwillbeeithe...
![「BZOJ1688」[Usaco2005 Open] Disease Manangement 疾病管理](http://hzwer.com/wp-content/themes/ly/image/image_post/2014-12-10_12-42-43.jpg)
DescriptionAlas!AsetofD(1<=D<=15)diseases(numbered1..D)isrunningthroughthefarm.FarmerJohnwouldliketomilkasmanyofhisN(1<=N<=1,000)cowsaspossible.IfthemilkedcowscarrymorethanK(1<=K<=D)differentdiseasesamongthem,thenthemilkwillbetoocontaminatedandwillhavetobediscardedinitsentirety.PleasehelpdeterminethelargestnumberofcowsFJcanmilkwithouthavingtodiscardthemilk.Input...
近期评论