CF284B.Cows and Poker Game
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There are n cows playing poker at a table. For the current betting phase, each player's status is either "ALLIN", "IN", or "FOLDED", and does not change throughout the phase. To increase the suspense, a player whose current status is not "FOLDED" may show his/her hand to the table. However, so as not to affect any betting decisions, he/she may only do so if all other players have a status of either "ALLIN" or "FOLDED". The player's own status may be either "ALLIN" or "IN".
Find the number of cows that can currently show their hands without affecting any betting decisions.
有 n 头奶牛正在一张牌桌上玩扑克。在当前的下注阶段,每位玩家的状态只能是“ALLIN”、“IN”或“FOLDED”,且在整个阶段中保持不变。为了增加悬念,当前状态不是“FOLDED”的玩家可以将自己的手牌展示给整张桌子看。然而,为避免影响任何下注决策,该玩家仅当其余所有玩家的状态均为“ALLIN”或“FOLDED”时,才被允许展示手牌。该玩家自身的状态可以是“ALLIN”或“IN”。
求当前能够在不影响任何下注决策的前提下展示手牌的奶牛数量。
输入格式
The first line contains a single integer, n (2 ≤ n ≤ 2·105). The second line contains n characters, each either "A", "I", or "F". The i-th character is "A" if the i-th player's status is "ALLIN", "I" if the i-th player's status is "IN", or "F" if the i-th player's status is "FOLDED".
第一行包含一个整数 n(2≤n≤2⋅105)。第二行包含 n 个字符,每个字符为 "A"、"I" 或 "F"。其中,第 i 个字符为 "A" 表示第 i 位玩家的状态是 "ALLIN",为 "I" 表示状态是 "IN",为 "F" 表示状态是 "FOLDED"。
输出格式
The first line should contain a single integer denoting the number of players that can currently show their hands.
第一行应包含一个整数,表示当前可以亮出手牌的玩家数量。
输入输出样例
输入#1
6 AFFAAA
输出#1
4
输入#2
3 AFI
输出#2
1
说明/提示
In the first sample, cows 1, 4, 5, and 6 can show their hands. In the second sample, only cow 3 can show her hand.
在第一个样例中,奶牛 1、4、5 和 6 可以展示它们的蹄子。在第二个样例中,只有奶牛 3 能够展示它的蹄子。
输入解题思路,AI测评打分。不知道怎么写?