QOJ.ac

QOJ

시간 제한: 1.0 s 메모리 제한: 1024 MB 총점: 100

#15444. AIMPPZ

통계

Alice 已经在职场拼搏多年,终于登上了权力巅峰。她刚刚成为了一家大型上市公司的首席执行官(CEO)。前任 CEO 因财务业绩不佳而被解雇,但 Alice 非常清楚如何提高利润。是时候选择一个新的公司名称了!

投资者喜欢任何关于人工智能(AI)的提及,尤其是在公司名称中。公司的基础价值等于其名称的长度,而子串 "AI" 的每次出现都会使公司的价值乘以 5。例如,名称 "AAICPCAIIA" 的长度为 10,且包含两次 "AI":

  • $\text{value}(\text{"AAICPCAIIA"}) = 10 \cdot 5 \cdot 5 = 250$

更多例子:

  • $\text{value}(\text{"AXI"}) = 3$("AI" 出现 0 次)
  • $\text{value}(\text{"AIAIAIAI"}) = 8 \cdot 5 \cdot 5 \cdot 5 \cdot 5 = 5000$("AI" 出现 4 次)
  • $\text{value}(\text{"AIMPPZ"}) = 6 \cdot 5 = 30$("AI" 出现 1 次)

如果公司的价值恰好为 $n$,Alice 的合同将保证她获得一笔极其丰厚的奖金。她还希望公司名称尽可能短。

Alice 已经开始忙于她的下一项任务——设计全新的 Logo。在此期间,你能为她提议一个新的公司名称吗?请找到一个由大写英文字母 A-Z 组成的、价值恰好为 $n$ 且长度最短的单词。

输入格式

仅包含一行,有一个整数 $n$ ($1 \le n \le 100\,000$) —— 期望的公司价值。

输出格式

输出一个由字母 A-Z 组成的单词 —— 一个价值为 $n$ 且长度最短的公司名称。如果存在多个满足条件的名称,输出其中任意一个。

样例

输入样例 1

30

输出样例 1

AIMPPZ

输入样例 2

250

输出样例 2

AAICPCAIIA

说明

在第一个样例中,我们寻找价值为 30 的最短可能名称。最优单词的长度为 6 且包含一次 "AI",例如 "AIMPPZ"、"HUAWAI"、"BRAINS" 和 "AAAIII"。没有更短的单词价值能达到 30。

在第二个样例中,价值 250 无法通过长度小于 10 的名称来实现。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.