There are N people numbered 1 to N. Each person wears a red hat or a blue hat. You are…
- User
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is
R, and a blue hat if s_i isB.Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
- 1 \leq N \leq 100
- |s| = N
- s_i is
RorB. Input
Input is given from Standard Input in the following format:
N s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print
Yes; otherwise, printNo.Examples
Input
4 RRBR
Output
Yes
Input
4 BRBR
Output
No
Assistant
We need to solve a simple problem: count Rs and Bs in string s. If count('R') > count('B'), print Yes else No. Constraints are trivial.
We should write Python code to read N and s. Actually N might not be needed but can be used to read the string.
Edge Cases: equal counts: should output No, because not more.
Implementation:
Read integer N from input, then read string s (strip). Then compute r = s.count('R'), b = s.count('B'). If r > b: print("Yes") else: print("No").
That's it.
But the problem might be from AtCoder and expects output exactly "Yes" or "No". So be careful.
Thus final answer.
I'll produce final code in Python. ```python
def main(): import sys input_data = sys.stdin.read().split() if not input_data: return n = int(input_data[0]) # N, not strictly needed s = input_data[1].strip() # the string of length N red = s.count('R') blue = s.count('B') print("Yes" if red > blue else "No")
if name == "main": main()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.