Universal Cup Judging System

Universal Cup

Límite de tiempo: 1.0 s Límite de memoria: 1024 MB Puntuación total: 100
Estadísticas

Alice は長年にわたり出世階段を登り続け、ついに頂点へと到達しました。彼女はとある大手上場企業の最高経営責任者(CEO)に就任したばかりです。前任の CEO は業績不振により解任されましたが、Alice は利益を押し上げる方法を熟知しています。新しい社名を決める時が来ました!

投資家は人工知能に関する言及、特に社名に含まれるものを好みます。企業の基本価値はその社名の長さに等しく、部分文字列「AI」が 1 回出現するごとに企業の価値は 5 倍になります。例えば、社名「AAICPCAIIA」は長さが 10 で、(下線が引かれた)「AI」が 2 回出現します:

  • $\operatorname{value}(\texttt{AAICPCAIIA}) = 10 \cdot 5 \cdot 5 = 250$

その他の例:

  • $\operatorname{value}(\texttt{AXI}) = 3$(「AI」の出現は 0 回)
  • $\operatorname{value}(\texttt{AIAIAIAI}) = 8 \cdot 5 \cdot 5 \cdot 5 \cdot 5 = 5000$(「AI」の出現は 4 回)
  • $\operatorname{value}(\texttt{AIMPPZ}) = 6 \cdot 5 = 30$(「AI」の出現は 1 回)

Alice の契約では、企業の価値がちょうど $n$ であれば、非常に手厚いボーナスが保証されています。また、彼女は社名をできるだけ短くしたいと考えています。

Alice はすでに次の仕事である新しいロゴのデザインで多忙です。その間に新しい社名を提案してくれませんか?英大文字 A-Z からなる、価値が $n$ の最も短い単語を見つけてください。

入力

唯一の行には、目標とする企業価値を表す整数 $n$ ($1 \le n \le 100\,000$) が含まれます。

出力

文字 A-Z からなる単語、すなわち価値が $n$ で長さが最小の社名を出力してください。解が複数存在する場合は、そのうちのどれを出力しても構いません。

入出力例

入力 1

30

出力 1

AIMPPZ

入力 2

250

出力 2

AAICPCAIIA

注記

1 つ目のテストでは、価値が 30 となる最も短い社名を探します。最適な単語は長さが 6 で「AI」を 1 回含み、例えば「AIMPPZ」、「HUAWAI」、「BRAINS」、「AAAIII」などがあります。価値が 30 となるこれより短い単語は存在しません。

2 つ目のテストでは、10 文字未満の社名で価値 250 を達成することはできません。

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.