C. [Atc349C]Airport Code

    传统题 1000ms 256MiB

[Atc349C]Airport Code

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

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:

  1. Take a subsequence of length 33 from SS (not necessarily contiguous) and convert it to uppercase letters to form TT.
  2. Take a subsequence of length 22 from SS (not necessarily contiguous), convert it to uppercase letters, and append XX 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 provided in the following format:

S
T

Output

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

Example

narita
NRT
Yes

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

losangeles
LAX
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.

snuke
RNG
No

Programming exercise on 14 August

未参加
状态
已结束
规则
XCPC
题目
3
开始于
2024-8-14 16:30
结束于
2024-8-14 18:30
持续时间
2 小时
主持人
参赛人数
2