#abc236c. C - Route Map
C - Route Map
Score : points
问题描述
在AtCoder铁路公司运营的一条特定线路上有个车站。从起点站开始的第个车站()被命名为。
普通列车会在所有车站停车,而特快列车则可能不停靠所有车站。具体来说,特快列车仅在个车站()停靠,其中第个停靠站()为名为的车站。这里保证了和,即特快列车在起始站和终点站都会停车。
对于这个车站中的每一个,请确定特快列车是否在该车站停靠。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are stations on a certain line operated by AtCoder Railway. The -th station from the starting station is named .
Local trains stop at all stations, while express trains may not. Specifically, express trains stop at only stations, and the -th stop is the station named .
Here, it is guaranteed that and , that is, express trains stop at both starting and terminal stations.
For each of the stations, determine whether express trains stop at that station.
Constrains
- and are integers.
- is a string of length between and (inclusive) consisting of lowercase English letters.
- and .
- is obtained by removing zero or more strings from and lining up the remaining strings without changing the order.
Input
Input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain Yes
if express trains stop at the -th station from the starting station, and No
otherwise.
Sample Input 1
5 3
tokyo kanda akiba okachi ueno
tokyo akiba ueno
Sample Output 1
Yes
No
Yes
No
Yes
Sample Input 2
7 7
a t c o d e r
a t c o d e r
Sample Output 2
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Express trains may stop at all stations.
update @ 2024/3/10 10:13:33