AtCoder 反转竞赛AI (CI翻译)
Problem Statement
题目描述
AI (CI翻译)For a string $S$ consisting of uppercase English letters, let $f(S)$ be the maximum number of times the following operation can be performed when it is repeated zero or more times.
对于一个由大写英文字母组成的字符串 $S$,令 $f(S)$ 表示重复执行以下操作零次或多次时,最多可以执行的操作次数。AI (CI翻译)
- Choose one occurrence of the substring
ARCand replace it withCRA.
- 选择一个子串
ARC的出现位置,并将其替换为CRA。
For example, for $S=$ ARARC, $f(S)=2$ (the operations ARARC $\to$ ARCRA $\to$ CRARA can be performed, and this is the maximum).
例如,对于 $S=$ ARARC,$f(S)=2$(可以依次执行 ARARC $ o$ ARCRA $ o$ CRARA,且这是最多的操作次数)。AI (CI翻译)
You are given an integer $X$ between $0$ and $600$ (inclusive).
给定一个 $0$ 到 $600$(含)之间的整数 $X$。AI (CI翻译)
Find one string $S$ consisting of uppercase English letters, of length between $1$ and $100$ (inclusive), satisfying $f(S)=X$.
请找出一个由大写英文字母组成的字符串 $S$,其长度在 $1$ 到 $100$(含)之间,且满足 $f(S)=X$。AI (CI翻译)
It can be proved that such a string always exists under the constraints.
可以证明,在给定约束下,这样的字符串总是存在。AI (CI翻译)
Constraints
约束条件
AI (CI翻译)$0\le X\le 600$- The input value is an integer.
$0\le X\le 600$- 输入值为整数。
Input
输入格式
AI (CI翻译)The input is given from Standard Input in the following format:
输入从标准输入按以下格式给出:AI (CI翻译)
X
XAI (CI翻译)
Output
输出格式
AI (CI翻译)Output one string $S$ consisting of uppercase English letters, of length between $1$ and $100$ (inclusive), satisfying $f(S)=X$.
输出一个由大写英文字母组成的字符串 $S$,其长度在 $1$ 到 $100$(含)之间,且满足 $f(S)=X$。AI (CI翻译)
If there are multiple such strings $S$, any of them will be accepted.
如果有多个满足条件的字符串 $S$,输出其中任意一个即可。AI (CI翻译)
样例
2
ARARC
0
ATCODER
3
ARARCDARC
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。