QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: jiangly

Posted at: 2025-12-13 00:06:24

Last updated: 2025-12-13 00:06:26

Back to Problem

题解

容易发现充要条件是存在如下三种情况之一:

.ab
ab.
.a
ab
b.
.a..
a...
...b
..b.

扫一遍即可,时间复杂度 $O(nm)$。

Comments

No comments yet.