Sports Day
InterviewTime limit2sMemory limit1024 MB
Given N students, K on the Red Team, and a string listing the other N-1 students' teams, decide Aoi's team.
- Level
Easy1 of 10
- Topics
- Implementation, String, Math, Array
- Solved
- No attempts yet
Problem
JOI High School has N students, numbered 1 through N.
Next month the school holds a sports day, and all N students take part. K of the students belong to the Red Team, and the remaining N-K belong to the White Team.
Aoi, student number N, has forgotten which team she belongs to. She decides to ask each of the other N-1 students which team they belong to, and use their answers to determine her own team.
The team information for the N-1 students other than Aoi is given as a string S of length N-1. Each character of S is either R or W, with the following meaning.
- If the
i-th character ofS(1 ≦ i ≦ N-1) isR, student numberibelongs to the Red Team. - If the
i-th character ofS(1 ≦ i ≦ N-1) isW, student numberibelongs to the White Team.
Output R if Aoi belongs to the Red Team, and W if she belongs to the White Team.
Input
The input is given from standard input in the following format.
N
K
S
Output
Output R if Aoi belongs to the Red Team, and W if she belongs to the White Team.
Constraints
2 ≦ N ≦ 2000.1 ≦ K ≦ N-1.Sis a string of lengthN-1.- Each character of
Sis eitherRorW. - The number of
Rcharacters inSis eitherK-1orK. NandKare integers.