#abc349c. C - Airport Code

    ID: 4008 传统题 1000ms 256MiB 尝试: 1 已通过: 1 难度: 10 上传者: 标签>来源atcoderC++语法高级字符串基础算法枚举

C - Airport Code

Score: 300300 points

问题陈述

一个由大写英文字母组成的长度为 33 的字符串 TT 是由小写英文字母组成的字符串 SS机场代码,当且仅当 TT 可以通过以下方法之一从 SS 派生出来:

  • SS 中取出长度为 33 的子序列(不一定是连续的),并将其转换为大写字母以形成 TT
  • SS 中取出长度为 22 的子序列(不一定是连续的),将其转换为大写字母,并在末尾添加 X 以形成 TT

给定字符串 SSTT,请确定 TT 是否是 SS 的机场代码。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

A string TT of length 33 consisting of uppercase English letters is an airport code for a string SS of lowercase English letters if and only if TT can be derived from SS by one of the following methods:

  • Take a subsequence of length 33 from SS (not necessarily contiguous) and convert it to uppercase letters to form TT.
  • Take a subsequence of length 22 from SS (not necessarily contiguous), convert it to uppercase letters, and append X to the end to form TT.

Given strings SS and TT, determine if TT is an airport code for SS.

Constraints

  • SS is a string of lowercase English letters with a length between 33 and 10510^5, inclusive.
  • TT is a string of uppercase English letters with a length of 33.

Input

The input is given from Standard Input in the following format:

SS

TT

Output

Print Yes if TT is an airport code for SS, and No otherwise.

Sample Input 1

narita
NRT

Sample Output 1

Yes

The subsequence nrt of narita, when converted to uppercase, forms the string NRT, which is an airport code for narita.

Sample Input 2

losangeles
LAX

Sample Output 2

Yes

The subsequence la of losangeles, when converted to uppercase and appended with X, forms the string LAX, which is an airport code for losangeles.

Sample Input 3

snuke
RNG

Sample Output 3

No