AT_abc463_b.Train Reservation

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Takahashi is trying to reserve a seat on a train.

There are NN trains he is considering as candidates for reservation, numbered 1,2,…,N1, 2, \dots, N. Each train has seats in five columns, called column A, column B, column C, column D, and column E.

The current seat availability information for each train is given as strings S1,S2,…,SNS_1, S_2, \dots, S_N. Here, S1,S2,…,SNS_1, S_2, \dots, S_N all have length 55, and columns A through E of train ii correspond to the first through fifth characters of SiS_i, respectively. If that character is o, there is a vacant seat in the corresponding column; if it is x, there is no vacant seat in the corresponding column.

Takahashi wants to reserve a seat in column XX, where XX is one of A, B, C, D, E. Determine whether there is a vacant seat in column XX on at least one train.

高桥正在尝试预订一列火车的座位。

他考虑了 NN 列候选火车,编号为 1,2,…,N1, 2, \dots, N。每列火车的座位分为五列,分别称为 A 列、B 列、C 列、D 列和 E 列。

每列火车当前的座位可用信息以字符串 S1,S2,…,SNS_1, S_2, \dots, S_N 给出。其中,S1,S2,…,SNS_1, S_2, \dots, S_N 的长度均为 55,且第 ii 列火车的 A 至 E 列分别对应于字符串 SiS_i 的第 11 至第 55 个字符。若该字符为 o,表示对应列有空座位;若为 x,则表示对应列无空座位。

高桥希望预订第 XX 列的座位,其中 XX 是 A、B、C、D、E 中的一个。请判断是否至少存在一列火车,在其第 XX 列中有空座位。

输入格式

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

NN XX
S1S_1
S2S_2
⋮\vdots
SNS_N

输入从标准输入中按以下格式给出:

NN XX
S1S_1
S2S_2
⋮\vdots
SNS_N

输出格式

If there is a vacant seat in column XX on at least one train, output Yes; otherwise, output No.

如果至少有一列火车在第 XX 列存在空座位,则输出 Yes;否则,输出 No。

输入输出样例

  • 输入#1

    3 A
    xoxox
    xxooo
    oxxxx

    输出#1

    Yes
  • 输入#2

    5 C
    xoxoo
    oxxoo
    oxxxo
    xoxxx
    oxxoo

    输出#2

    No

说明/提示

Sample 1 Explanation:
Train 33 has a vacant seat in column A. Thus, output Yes.

Sample 2 Explanation:
No train has a vacant seat in column C. Thus, output No.

Constraints

  • NN is an integer between 11 and 100100, inclusive.
  • XX is one of A, B, C, D, E.
  • SiS_i is a string of length 55 consisting of o and x.

样例 1 解释:
列车 3 的 A 列有一个空座位。因此,输出 Yes。

样例 2 解释:
没有任何列车的 C 列有空座位。因此,输出 No。

约束条件

  • NN 是一个介于 11 到 100100(含)之间的整数。
  • XX 是 A、B、C、D、E 中的一个字符。
  • SiS_i 是一个长度为 55 的字符串,仅由字符 o 和 x 组成。

输入解题思路,AI测评打分。不知道怎么写?

首页