![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ZOJ
穷源溯流
路很长,尽管走便是。
展开
-
ZOJ 3430 Detect the Virus(AC自动机)
给出 n 个模式串以 base64 编码,再给出 m 个文本串以 base64 编码,问这 m 个文本串中出现过多少次模式串 题目若是没有以 base64 编码为条件就是一道 AC自动机的模板题,但是区区一个编码就变成了自闭题 首先搞清楚 base64 编码的规则,题目中已经给出了 hello 的样例,就是将 hello 的 acsll 码转化为二进制,然后每 6 位按题目中给出的表进行对字符进行转化,= 忽略即可 而题目要求我们求文本串的匹配,自然要将给出的 base64 进行解码,由...原创 2021-02-23 11:16:48 · 156 阅读 · 1 评论 -
ZOJ 3233 Lucky Number(容斥原理×2)
给你 n 个幸运数字,和 m 个不幸运数字,定义好数:被任意一个幸运数字整除且不被任意的不幸运数字整除的称为好数,求 [L,R] 区间内有多少好数 题目看起来不算很简单,开始先算在区间 [L,R] 内的幸运数字应该不算太难,利用容斥原理,奇加偶减,答案为 ans 但是都不满足被不幸运数字整除就有点困难了,如果一个数 x 不能被任意一个不幸运数字整除,那么 x 一定不能被不幸运数字的 lcm 所整除,然后对于每一个幸运数字的倍数 t*a[i,j,k](t 为倍数) 与 lcm 的最小公倍数,...原创 2020-11-09 09:10:04 · 263 阅读 · 0 评论 -
Alice's Print Service(upper_bound)
Alice is providing print service, while the pricing doesn't seem to be reasonable, so people using her print service found some tricks to save money. For example, the price when printing less than ...原创 2020-05-05 09:17:44 · 209 阅读 · 0 评论 -
Food Delivery
When we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery. Suppose there are N people living ...原创 2020-04-28 11:49:33 · 1340 阅读 · 0 评论 -
Battle Ships
Battle Ships is a new game which is similar to Star Craft. In this game, the enemy builds a defense tower, which has L longevity. The player has a military factory, which can produce N kinds of battle...原创 2020-04-26 12:58:48 · 252 阅读 · 0 评论