QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 32 MB Puntuación total: 50

#13726. 桥牌

Estadísticas

在用新手机玩了几个月游戏后,Mirko 终于决定寻找一个新的爱好。他发现了一种叫做桥牌(bridge)的纸牌游戏!

众所周知,桥牌由四名玩家使用一副 52 张的扑克牌进行,共有 4 种花色(梅花、红桃、方片和黑桃)和 13 种点数(A、K、Q、J、10、9、8、7、6、5、4、3 和 2)。在游戏开始时,每位玩家会被分发 13 张牌。

在游戏开始前,每位玩家会按照以下方式计算他们所谓的“大牌点”(honor points):

  • 每张 A(Ace)值 4 分
  • 每张 K(King)值 3 分
  • 每张 Q(Queen)值 2 分
  • 每张 J(Jack)值 1 分
  • 其余的牌(在本题中用 X 表示)值 0 分。

鉴于 Mirko 最近才开始玩桥牌,他决定练习计算点数。他给自己发了 $N$ 次牌,每次都计算了自己的大牌点。最后,他把它们加了起来。

他想知道自己算得对不对。请帮助 Mirko 进行检查!

输入格式

输入的第一行包含题目中的整数 $N$ ($1 \le N \le 10\,000$)。

接下来的 $N$ 行,每行包含一个长度为 13 的字符串 $K_i$,由字符 'A'、'K'、'Q'、'J'、'X' 组成,代表 Mirko 第 $i$ 次发牌后手中的牌。

输出格式

输出的第一行也是唯一一行,必须包含题目所求的总和。

样例

输入样例 1

1
AKXAKJXXXAXAQ

输出样例 1

25

输入样例 2

4
XXXAXXXXXXJXX
KXAXXXQJAXXXX
AQKQXXXKXXKQX
JXXXXXJXXXXXX

输出样例 2

40

说明

第一个样例的解释:

Mirko 的手中总共有 4 张 A、2 张 K、1 张 Q 和 1 张 J。总计为 $4 * 4 + 2 * 3 + 1 * 2 + 1 * 1 = 25$ 大牌点。

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.