传统题 1000ms 256MiB

B - Prefix?

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

B - Prefix?

Score : $200$ points

Problem Statement

You are given two strings $S$ and $T$ consisting of lowercase English letters. Determine if $S$ is a prefix of $T$.

What is a prefix? A prefix of a string $T_1T_2\ldots T_N$ of length $N$ is a string expressed as the first $i$ characters of $T$, $T_1T_2\ldots T_i$, where $i$ is an integer such that $0 \leq i \leq N$. For example, when $T = $ abc, there are four prefixes of $T$: an empty string, a, ab, and abc.

Constraints

  • $S$ and $T$ are strings of lengths between $1$ and $100$ (inclusive) consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

SS

TT

Output

Print Yes if $S$ is a prefix of $T$; print No otherwise. Note that the judge is case-sensitive.


atco
atcoder
Yes

atco is a prefix of atcoder. Thus, Yes should be printed.


code
atcoder
No

code is not a prefix of atcoder. Thus, No should be printed.


abc
abc
Yes

Note that a string is also a prefix of itself.


aaaa
aa
No

2024暑假入门组刷题营第三期(三)

未参加
状态
已结束
规则
IOI
题目
8
开始于
2024-7-10 13:00
结束于
2024-7-10 15:00
持续时间
2 小时
主持人
参赛人数
7