洛谷题目链接:[POI2010]ANT-Antisymmetry 题目描述 Byteasar studies certain strings of zeroes and ones. Let be such a string. By we will denote the reversed (i.e., "read backwards") string , and by we will denote the string obtained from by changing all the…
洛谷P3502 [POI2010]CHO-Hamsters感想及题解(图论+字符串+矩阵加速\(dp\&Floyd\)) 标签:题解 阅读体验:https://zybuluo.com/Junlier/note/1310683 扯闲谈 觉得这是道比较好的引导模型转换的题,就决定写一篇题解 即使我就是看的ZSY的,并且几乎写的一模一样(还是稍有不同的) 安利一发租酥雨的题解 原题地址:洛谷P3502 [POI2010]CHO-Hamsters 先理解题意 给出\(n\)个字符串,让你用这\(n\)个…
洛谷 P3805 [模板]manacher算法 洛谷传送门 题目描述 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度. 字符串长度为n 输入格式 一行小写英文字符a,b,c...y,z组成的字符串S 输出格式 一个整数表示答案 输入输出样例 输入 #1复制 输出 #1复制 说明/提示 字符串长度len <= 11000000 题解: 都说了是\(Manacher\)算法的模板了... 关于马拉车算法,如有不懂请参考本蒟蒻的这篇博客: 详解Manacher算法…
题意描述 原题: 一句话描述:对于一个0/1序列,求出其中异或意义下回文的子串数量. 题解 我们可以看出,这个其实是一个对于异或意义下的回文子串数量的统计,什么是异或意义下呢?平常,我们对回文的定义是,对于任意$i$,$S[i]=S[n-i+1]$,而我们把相等改为异或操作,那么,当且仅当$1$与$0$相匹配时,返回值为$1$ 也就是 “真”. 那么,我们可以尝试使用Manache算法来解决.当然,编程时,我们并不必真的去把0/1序列转换为数字序列,进行异或操作,这样会给自己增加一波常数(迷),…
洛谷题目传送门 萝卜大毒瘤 题意可以简化成这样:给一个DAG,求每个点能够从多少个入度为\(0\)的点到达(记为\(k\)). 一个随机做法:给每个入度为\(0\)的点随机一个权值,在DAG上求出每个点能够返回到的入度为\(0\)的点的最小权值,那么这个权值的期望是\(\frac{\text{随机值域}}{k+1}\).多选几套随机权值(蒟蒻选了一百次),跑出来的平均值即可输出. 实在是太玄学了. #include<bits/stdc++.h> #define LL unsigned long…
P3496 [POI2010]GIL-Guilds 题目描述 King Byteasar faces a serious matter. Two competing trade organisations, The Tailors Guild and The Sewers Guild asked, at the same time, for permissions to open their offices in each town of the kingdom. There are  town…
P3507 [POI2010]GRA-The Minima Game 题目描述 Alice and Bob learned the minima game, which they like very much, recently. The rules of the game are as follows. A certain number of cards lies on a table, each inscribed with a positive integer. The players m…
P3505 [POI2010]TEL-Teleportation 题目描述 King Byteasar is the ruler of the whole solar system that contains  planets. This number is so large that people have abandoned the silly custom of naming the planets and use numbers instead. The planets are thus…
    这是一道字符串建模+图论的问题. 题目描述 Byteasar breeds hamsters. Each hamster has a unique name, consisting of lower case letters of the English alphabet. The hamsters have a vast and comfortable cage. Byteasar intends to place a display under the cage to visuali…
题目描述 Alice and Bob learned the minima game, which they like very much, recently. The rules of the game are as follows. A certain number of cards lies on a table, each inscribed with a positive integer. The players make alternate moves, Alice making t…