我对分治的理解:https://www.cnblogs.com/AKMer/p/9728574.html 题目传送门:https://www.luogu.org/problemnew/show/P3612 因为每次操作都会使原串增长一倍,并且后半部分与前半部分极其相似,所以我们可以将其分治. 因为是将原串的最后一个字符放到第一个来,其余字符全部后移一位,所以在后一半的第\(i\)位就是前一半的第\(i-1\)位,如果是后一半的第\(1\)位,那么就是前一半的第\(len\)位.我们每次分治可以将…
题目描述 After several months of rehearsal, the cows are just about ready to put on their annual dance performance; this year they are performing the famous bovine ballet "Cowpelia". The only aspect of the show that remains to be determined is the s…
题目传送门 Promotion Counting 题目描述 The cows have once again tried to form a startup company, failing to remember from past experience that cows make terrible managers! The cows, conveniently numbered 1 \ldots N1…N (1 \leq N \leq 100,0001≤N≤100,000), organ…
题目描述:zxyer为了防止他的标程被别人抄走,他在计算机中的rar文件上设置了一个密码,其中每一个密码都有一个初始字符串,字符串由大写字母组成,且长度不超过30位,每一个密码还有一个询问,询问为一个整数n,表示询问当前第n位的字符为哪个字母. 字符串的加密过程如下:假设原字符串有n位,将原始字符串的第n位拿出,将该字母变成新的字符串的第一个字母,然后再将原始字符串的前n-1位放在新字符串的第2~n位,最后再将旧字符串与新字符串合并(即把新字符串放在旧字符串后面),加密过程可进行无限次. 很不巧…
P3608 [USACO17JAN]Balanced Photo平衡的照片 题目描述 Farmer John is arranging his NN cows in a line to take a photo (1 \leq N \leq 100,0001≤N≤100,000). The height of the iith cow in sequence is h_ih​i​​, and the heights of all cows are distinct. As with all ph…
P3609 [USACO17JAN]Hoof, Paper, Scissor蹄子剪刀… 题目背景 欢迎提供翻译,请直接在讨论区发帖,感谢你的贡献. 题目描述 You have probably heard of the game "Rock, Paper, Scissors". The cows like to play a similar game they call "Hoof, Paper, Scissors". The rules of "Hoof…
题目戳 题目描述 Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are getting tired, though, so they want to be able to use as little energy as possible to jump over th…
题目描述 Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over hurdles. They are getting tired, though, so they want to be able to use as little energy as possible to jump over the hu…
P2986 [USACO10MAR]伟大的奶牛聚集Great Cow Gat… 题目描述 Bessie is planning the annual Great Cow Gathering for cows all across the country and, of course, she would like to choose the most convenient location for the gathering to take place. Each cow lives in on…
题目描述 The cows have once again tried to form a startup company, failing to remember from past experience that cows make terrible managers! The cows, conveniently numbered $1 \ldots N\left( 1\leq N\leq 100,000\right)$ organize the company as a tree, wi…