2016-2017 CT S03E07: HackerEarth Problems Compilation

From EOJ Wiki
Revision as of 11:11, 9 December 2018 by Kblack (talk | contribs) (→‎Problem I)
Jump to navigation Jump to search

Problem A

Solved by ultmaster. 04:51 (+4)

题意:给 $n$ 个串,有两种操作,一种是给某个串加一个字符,另一种是求存不存在一个串是查询串的子串。强制在线。

题解:由于限制了总长,所以不同的长度不会太多(根号级别)。枚举长度匹配一下哈希就行。把素数改成 unsigned long long 就能 AC 了。

所以为什么大家都是用自动机过的啊?

Problem B

Solved by zerol. 00:13 (+)

Problem C

Solved by ultmaster. 01:13 (+)

Problem D

Solved by zerol & kblack. 02:30 (+5)

Problem E

Solved by ultmaster. 00:16 (+)

排序签到。

Problem F

Solved by ultmaster. 03:31 (+1)

Problem G

Solved by zerol. 04:01 (+)

Problem I

Solved by kblack. 01:36 (+1)

题意:a 转化到 b,转化方式是加减质数,要求过程量全部都是质数。

题解:要么直接 +2 过去,要么从 2 中转,瞎几把判判。

Problem J

Solved by kblack. 03:49 (+4)

题意:给一个带点权的树,询问一条链,求点权和最大的子链。

题解:按是否跨过 LCA 分类,树上前缀和转化为最大差后,用倍增处理最大值最小值最大差,瞎几把合并,特判直接连接 LCA 的情况,合并两边。

Problem K

Solved by ultmaster. 02:12 (+)