CF1659A.Red Versus Blue

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of nn matches.

In the end, it turned out Team Red won rr times and Team Blue won bb times. Team Blue was less skilled than Team Red, so bb was strictly less than rr.

You missed the stream since you overslept, but you think that the match must have been neck and neck since so many people watched it. So you imagine a string of length nn where the ii-th character denotes who won the ii-th match — it is R if Team Red won or B if Team Blue won. You imagine the string was such that the maximum number of times a team won in a row was as small as possible. For example, in the series of matches RBBRRRB, Team Red won 33 times in a row, which is the maximum.

You must find a string satisfying the above conditions. If there are multiple answers, print any.

红队与蓝队进行了一场竞技性第一人称射击(FPS)比赛,比赛在全球范围内进行了直播。双方共进行了 nn 场对局。

最终结果是:红队获胜 rr 次,蓝队获胜 bb 次。由于蓝队实力弱于红队,故 bb 严格小于 rr。

你因睡过头而错过了直播,但你认为这场比赛一定十分胶着——毕竟有如此多观众观看了直播。因此,你构想了一个长度为 nn 的字符串,其中第 ii 个字符表示第 ii 场对局的胜者:若红队获胜则为 R,若蓝队获胜则为 B。你希望该字符串满足:某支队伍连续获胜的最大次数尽可能小。例如,在对局序列 RBBRRRB 中,红队曾连续获胜 33 次,这是该序列中最大的连续获胜次数。

你需要构造一个满足上述条件的字符串。如有多种可行答案,输出任意一个即可。

输入格式

The first line contains a single integer tt (1≤t≤10001 \le t \le 1000) — the number of test cases.

Each test case has a single line containing three integers nn, rr, and bb (3≤n≤1003 \leq n \leq 100; 1≤b<r≤n1 \leq b \lt r \leq n, r+b=nr+b=n).

第一行包含一个整数 tt(1≤t≤10001 \le t \le 1000)—— 表示测试用例的数量。

每个测试用例占一行,包含三个整数 nn、rr 和 bb(3≤n≤1003 \leq n \leq 100;1≤b<r≤n1 \leq b \lt r \leq n,且 r+b=nr+b=n)。

输出格式

For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.

对于每个测试用例,输出一行满足给定条件的字符串。如果存在多个答案,输出任意一个即可。

输入输出样例

  • 输入#1

    3
    7 4 3
    6 5 1
    19 13 6

    输出#1

    RBRBRBR
    RRRBRR
    RRBRRBRRBRRBRRBRRBR
  • 输入#2

    6
    3 2 1
    10 6 4
    11 6 5
    10 9 1
    10 8 2
    11 9 2

    输出#2

    RBR
    RRBRBRBRBR
    RBRBRBRBRBR
    RRRRRBRRRR
    RRRBRRRBRR
    RRRBRRRBRRR

说明/提示

The first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is 11. We cannot minimize it any further.

The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wins in a row is 22, given by RR at the beginning. We cannot minimize the answer any further.

第一个示例的第一个测试用例给出了题干示例的最优答案。在序列 RBRBRBR 中,一支队伍连续获胜的最大次数为 11。我们无法进一步减小该值。

第二个示例的第二个测试用例的答案为 RRBRBRBRBR。其中一支队伍连续获胜的最大次数为 22,由开头的 RR 给出。我们无法进一步减小该答案。

输入解题思路,AI测评打分。不知道怎么写?

首页