QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 32 MB 満点: 15

#17569. TRIK

統計

Borko 嫉妒 Mirko 作为村长的地位,他冲进 Mirko 的帐篷,试图用一个魔术来证明 Mirko 不配当领导。

Borko 在桌上并排倒扣了三个不透明的杯子,并在最左边的杯子下面放了一颗小球。然后,他多次以三种可能的方式之一交换两个杯子的位置。Mirko 必须指出小球最终在哪个杯子下面。

聪明的 Mirko 双臂交叉,面带微笑,而 Borko 则费力地把杯子移动得越来越快。Borko 不知道的是,后台的程序员们正在记录他的所有动作,并将使用一个简单的程序来确定小球的位置。请编写该程序。

输入格式

第一行也是唯一的一行包含一个长度最多为 50 的字符串,表示 Borko 的移动步骤。

字符串中的每个字符均为 'A''B''C'(不带引号)。

输出格式

输出小球所在杯子的编号:如果它在左边的杯子下面,输出 1;如果在中间的杯子下面,输出 2;如果在右边的杯子下面,输出 3。

样例

输入样例 1

AB

输出样例 1

3

输入样例 2

CBABCACCC

输出样例 2

1

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.