2017 青岛现场赛 Suffix】的更多相关文章

Consider n given non-empty strings denoted by s1 , s2 , · · · , sn . Now for each of them, you need to select a corresponding suffix, denoted by suf1, suf2, · · · , sufn. For each string si, the suffix sufi is a non-empty substring whose right endpoi…
Lusrica designs a mosquito coil in a board with n × n grids. The mosquito coil is a series of consecutive grids, each two neighboring grids of which share a common border. If two grids in the mosquito coil are not consecutive, they do not share any b…
先贴代码,以及简要题解. 和一个队友下午双排打了一下,队友光速签到,我签的J被嫌弃写得慢以及演员...然后我秒出了E了思路然而难以置信这么简单的思路当时才过了十几个,于是发现D.F不是太好做.最后交了13发E才过,中间爆ll.memset超时..赛后补了F. 只贴我写的三个题. J: ZOJ 4067 题解:把所有0拿掉后贪心拿完前面的,然后再加上后面的最小值-1.改了三次在基佬紫帮助下才写对. #include<cstdio> #include<iostream> #includ…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6212 解法:看了眼题就发现这个BZOJ 1032不是一毛一样?但是BZOJ上那是个巨坑,数据有错,原来A的是一个假题..2333,但是我并不知道POJ上也有这个题2333...网赛现场没做出来,感觉现场做出来的很多都知道这个题是原题吧..参考这个论文:http://www.docin.com/p-685411874.html 解法:这个题主要是区间DP的转移怎么写? 有三种消除方式: 1.直接将区间…
题意:BaoBao正在进行在线考试(都是选择题),每个题都有唯一的一个正确答案,但是考试系统有m个bug(就是有m个限制),每个bug表示为第u个问题和第v个问题你必须选择相同的选项,题目问你,如果你修好了第i个bug,BaoBao最高可以取得多少分. 题目数量1e5BUG数量1e5(真多)答案范围1e5 思路:首先,如果出现了bug,导致{a1,a2,...,an}n个题目必须选择一样的结果,那么最高得分肯定是众数的出现次数.我们发现bug是具有传递性的,如果bug连成了一个环,而且你只修复其…
题意: 你的房子在0点,1,2,3,...,n(n<=1e5)点每个点都有一颗高度为0的花,浇一次水花会长a[i]. 你有一个机器人刚开始在你家,最多走m步,每一步只能往前走或者往后走,每走到一个地方除了房子都会给花浇水,问m步以后最低那朵花的高度最大是多少. 思路:二分,并且可以证明左右横跳(即这一个点不够我们就来回走一直到够高度为止). 需要注意步数用完直接break,每一朵花浇够次数立刻走向下一朵花(如果还有步数). 代码: #include<bits/stdc++.h> #def…
题面:http://acm.zju.edu.cn/contest-materials/qd2018/qd2018_problems.pdf 题意: n个骑士决斗K轮 要求是每个骑士只能跟另外一个骑士决斗一次 每轮必须有 n/2 场决斗 如果在某轮A和B单挑,C和D单挑 那么在下面的论场中必然有A和C单挑同时B和D单挑 思路: 用一个set存每个骑士还没单挑过的其他骑士编号,一个set存每轮还没有单挑过的骑士 先预处理第一轮的21436587······ 第一个骑士每轮单挑必然是单挑的轮数+1(如…
Bob is attending a chess competition. Now the competition is in the knockout phase. There are 2^r2r players now, and they will play over rr rounds. In each knockout round, the remaining players would be divided into pairs, and the winner of each pair…
A Cubic number and A Cubic Number Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 4947    Accepted Submission(s): 1346 Problem Description A cubic number is the result of using a whole number i…
Chinese Zodiac Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 2451    Accepted Submission(s): 1645 Problem Description The Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle,…