URAL Palindromic Contest】的更多相关文章

A. Non-palidromic cutting 考虑无解的情形:只能是形如$aaaaa$.$aaabaaa$.$abababa$这三种情况. 有解时,对于最小划分,答案必定是$1$或者$2$,判断整个串是否是回文串即可. 对于最大划分,设$f[i]$表示前$i$个字符的最大划分,则$f[i]=\max(f[j]+1)$,其中$[j+1,i]$有解,这里将限制放宽是因为放宽后最优解不会变化,且条件更加好判断. 可行的$j$可以根据$aaaaa$.$abababa$分奇偶得出两个上界,对于$aa…
Palindromes and Super Abilities Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged on Ural. Original ID: 196064-bit integer IO format: %lld      Java class name: (Any) After solving seven problems on Timus Online Judge with a word “…
Legendary Teams Contest Time limit: 1.0 secondMemory limit: 64 MB Nothing makes as old as years. A lot of cool contests are gone, a lot of programmers are not students anymore and are not allowed to take part at the contests. Though their spirit is f…
POJ 上的一套水题,哈哈~~~,最后一题很恶心,不想写了~~~ Rope Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7410   Accepted: 2603 Description Plotters have barberically hammered N nails into an innocent plane shape, so that one can see now only heads. Moreove…
题意描述:给定K支队伍,每队三个队员,不同队伍之间队员可能部分重复,输出这些队员同时能够组成多少完整的队伍: DFS,利用DFS深度优先搜索,如果该队所有队员都没有被访问过,那么将该队计入结果,再去选择下一队~ #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <stdlib.h> #include <map>…
A. Square Function 留坑. B. Guess by Remainder 询问$lcm(1,2,3,...,n)-1$即可一步猜出数. 计算$lcm$采用分治FFT即可,时间复杂度$O(n\log^2n)$. C. Subtract if Greater! 对于每个修改操作,$[1,x]$的数无需修改,$[x+1,2x]$的数会减小至少一半,暴力修改即可,$[2x+1,inf]$的数减小之后排名不变,故可以在平衡树上打标记实现. 时间复杂度$O(n\log^2n+m\log n)…
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and each orders a juice cocktail. It could be from 1 to 3 different juices in each cocktail. There are three juices in the bar: apple, banana and pineappl…
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best programmer in the world! Now he regularly takes part in various programming contests, attentively listens to problems analysis and upsolves problems. But…
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate integers together in their spare time. Nikolay thinks an integer is interesting if it is a prime number. However, Asya thinks an integer is interesting i…
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock band on Earth. Band decided to make the most awesome music video ever for their new single. In that music video Ilya will go through Manhattan standi…