#5028. Leftrightarrow

0
    ID: 5028 传统题 2000ms 1024MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>AtCoderabc345AGESP 3级枚举(单层循环)字符串

Leftrightarrow

Leftrightarrow

题目描述

You are given a string SS consisting of <, ==, and >.
确定字符串 SS 是否为一个 双向箭头 字符串。
当且仅当存在正整数 kk 使得 SS 是由一个 <、kk 个 == 和一个 > 按此顺序拼接而成且长度为 (k+2)(k+2) 时,SS 才是双向箭头字符串。

输入格式

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

输出格式

If SS is a bidirectional arrow string, print YesYes; otherwise, print NoNo.

Yes
==>
No
>
No

提示

SS is a string of length between 33 and 100100, inclusive, consisting of <, ==, and >.<====> is a concatenation of one <, four ==s, and one >, in this order, so it is a bidirectional arrow string.
Hence, print YesYes.
==> does not meet the condition for a bidirectional arrow string.
Hence, print NoNo.

标签: AtCoder|abc345A

来源

AtCoder|abc345A