問題一覧 > 通常問題

No.3637 PANDORA

レベル : / AI推定難易度 : 1025 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 28
作問者 : kazuppa / テスター : Unbakedbread Tamiji153
お気に入りにしたユーザー ProblemId : 13604 / 自分の提出
問題文最終更新日: 2026-08-25 18:36:01
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Paken新入生コンday2 (順位表) の他の問題:

Problem Statement

You are given a string $S$ of length $N$ consisting of lowercase English letters.

A total of $Q$ queries of the following $2$ types will be given. Process them in order.

  • 1 i c Update the $i$-th character of $S$ to $c$.
  • 2 t Answer whether $S$ contains $t$ as a subsequence.

Here, when a string $s'$ obtained by deleting $0$ or more characters from a string $s$ matches $t$, we define that $s$ contains $t$ as a subsequence.

Constraints

  • $1\leq N,Q\leq 2\times 10^5$
  • $S$ is a string of length $N$ consisting of lowercase English letters
  • In queries of type $1$, $1\leq i\leq N$
  • In queries of type $1$, $c$ is a lowercase English letter
  • In queries of type $2$, $t$ is a string of lowercase English letters with length at least $1$ and at most $10$
  • Queries of type $2$ are given at least $1$ time
  • All numbers given in the input are integers

Subtasks

This problem has partial scoring by subtasks.

Subtask Points Constraints
Subtask 15 %$N=1$
Subtask 25 %No queries of type $1$ are given; in queries of type $2$, $|t|=1$
Subtask 310 %In queries of type $2$, $|t|=1$
Subtask 410 %No queries of type $1$ are given; in queries of type $2$, $|t|=2$
Subtask 520 %In queries of type $2$, $|t|=2$
Subtask 620 %No queries of type $1$ are given
Subtask 730 %No additional constraints

Input

$N\ Q$
$S$
$Query_1$
$Query_2$
$\vdots$
$Query_Q$

Also, $Query$ is given as follows:

$1\ i\ c$
$2\ t$

It is given in one of the above forms.

Output

When query 2 is given $t$ times, print $t$ lines.

On the $i\ (1\leq i\leq t)$-th line, answer the $i$-th given query 2. Print Yes if it is contained, and No if it is not.

Sample

Sample 1
Input
5 5
abcde
2 ac
2 bf
1 3 f
2 ac
2 bf
Output
Yes
No
No
Yes

Before processing the 3rd query, $S=$abcde. At this point, $S$ contains ac as a subsequence but does not contain bf as a subsequence.

After processing the 3rd query, $S=$abfde. At this point, $S$ does not contain ac as a subsequence but contains bf as a subsequence.

Sample 2
Input
7 7
aitsuki
2 aitsuki
2 itsuki
2 azki
1 4 z
2 aitsuki
2 itsuki
2 azki
Output
Yes
Yes
No
No
No
Yes

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。