2017 CCPC秦皇岛 E题 String of CCPC】的更多相关文章

BaoBao has just found a string  of length  consisting of 'C' and 'P' in his pocket. As a big fan of the China Collegiate Programming Contest, BaoBao thinks a substring  of  is "good", if and only if  'C', and  'P', where  denotes the -th charact…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3985 题意: 给定一个字符串,由c和p组成,可以添加c或者p. 串中出现一个ccpc 价值+1(ccpc可以出现部分重叠),但是如果添加x个字母,那么花费为x-1.问“价值-花费”的总价值 最大. 最多总价值可以比原来串中的ccpc数目增加1,因为只有第一个字母不要钱,其他字母即使生成一个ccpc,花费也会随应的增加1. 只有一种情况可以再增加1个字母的时候生成两个,那就…
The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be  teams participating in the contest, and the contest will be held on a huge round table with  seats numbered from 1 to  in clockwise order around it. The -th team…
PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. BaoBao is a big fan of the game, bu…
BaoBao is trapped in a one-dimensional maze consisting of  grids arranged in a row! The grids are numbered from 1 to  from left to right, and the -th grid is marked with a character , where  is either 'L' or 'R'. Starting from the -th grid, BaoBao wi…
DreamGrid has a nonnegative integer . He would like to divide  into nonnegative integers  and minimizes their bitwise or (i.e.  and  should be as small as possible). Input There are multiple test cases. The first line of input contains an integer , i…
Given an array of  integers , we say a set  is a prime set of the given array, if  and  is prime. BaoBao has just found an array of  integers  in his pocket. He would like to select at most  prime set of that array to maximize the size of the union o…
Crusaders Quest is an interesting mobile game. A mysterious witch has brought great darkness to the game world, and the only hope for your kingdom is to save the Goddesses so that they can unleash their power to fight against the witch. In order to s…
2017 ccpc哈尔滨 A题 Palindrome 题意: 给一个串\(T\),计算存在多少子串S满足\(S[i]=S[2n−i]=S[2n+i−2](1≤i≤n)\) 思路: 很明显这里的回文串长度为奇数,所以用\(manacher\)处理时不需要添加间隔字符 所以这里的\(Len[i]\)表示的就是以\(i\)为中心的回文串向左右最远能延伸的长度 那么\(S[i]=S[2n−i]=S[2n+i−2](1≤i≤n)\)就等价于 找到一对$(i,j), 满足i - Len[i] + 1 <=…
美团点评2017校招笔试真题-算法工程师A 1.下面哪种STL容器的实现和其它三个不一样 A. set B. deque C. multimap D. map 正确答案: B STL的容器可以分为以下几个大类: 1. 顺序(序列)容器,有 vector,list,deque , string,stack( 适配器类), queue( 适配器类), priority queues( 适配器类). 2.关联容器,有set, multiset,map,multimap, bitset,hash_set…