AT_abc464_a.Decisive Battle

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

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

题目描述

The Eastern Army and the Western Army are at war in a certain capital.

Takahashi recorded information about the fighting forces as a string SS.
SS contains only the characters E and W, and the number of Es in SS equals the number of soldiers in the Eastern Army, and the number of Ws equals the number of soldiers in the Western Army.

Given the string SS that Takahashi recorded, output East if the Eastern Army has more soldiers than the Western Army, or West if the Western Army has more soldiers than the Eastern Army.

The length of SS is guaranteed to be odd. Thus, it can be proved that exactly one of the two armies strictly outnumbers the other (that is, the two armies cannot have the same number of soldiers).

东军与西军正在某首都交战。

高桥将双方兵力信息记录为一个字符串 SS。
SS 仅由字符 E 和 W 组成,其中 E 的个数等于东军士兵人数,W 的个数等于西军士兵人数。

给定高桥记录的字符串 SS,若东军士兵人数多于西军,则输出 East;若西军士兵人数多于东军,则输出 West。

字符串 SS 的长度保证为奇数。因此可以证明,两支军队中必有一支严格多于另一支(即两军士兵人数不可能相等)。

输入格式

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

SS

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

SS

输出格式

Output the answer.

输出答案。

输入输出样例

  • 输入#1

    EEWEW

    输出#1

    East
  • 输入#2

    WWWWWWW

    输出#2

    West

说明/提示

Sample 1 Explanation:
SS contains three Es and two Ws, so the Eastern Army has three soldiers and the Western Army has two soldiers.
Since the Eastern Army has more soldiers than the Western Army, output East.

Sample 2 Explanation:
SS contains zero Es and seven Ws, so the Eastern Army has zero soldiers and the Western Army has seven soldiers.
Since the Western Army has more soldiers than the Eastern Army, output West.

Constraints

  • SS is a string of length between 11 and 9999, inclusive, consisting of E and W.
  • The length of SS is odd.

样例 1 解释:
SS 包含三个 E 和两个 W,因此东方军队有三名士兵,西方军队有两名士兵。
由于东方军队的士兵数量多于西方军队,输出 East。

样例 2 解释:
SS 包含零个 E 和七个 W,因此东方军队有零名士兵,西方军队有七名士兵。
由于西方军队的士兵数量多于东方军队,输出 West。

约束条件

  • SS 是一个长度在 11 到 9999(包含端点)之间的字符串,且仅由字符 E 和 W 组成。
  • SS 的长度为奇数。

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

首页