QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 2048 MB Total points: 100

#15620. Decompose and Concatenate

统计

2 以上の整数が与えられます。この数を 2 つの正の整数の和に分解するとき、その 2 つの整数の十進法表記を連結することで新しい整数を作ることができます。このようにして作られる数の最大値を求めてください。

例えば、102 は以下のように分解して連結することができます。

$1 + 101 \to 1101$ $2 + 100 \to 2100$ $3 + 99 \to 399$ $4 + 98 \to 498$ $\vdots$ $101 + 1 \to 1011$

これらの中で、$92 + 10 \to 9210$ が最大となります。

入力

入力は単一のテストケースからなり、1 行で与えられます。その行には、分解および連結の対象となる 2 以上 $10^{17}$ 以下の整数が含まれます。

出力

可能な最大値を 1 行で出力してください。

入出力例

入力 1

8

出力 1

71

入力 2

2025

出力 2

10251000

入力 3

102

出力 3

9210

入力 4

99999999999999999

出力 4

8999999999999999910000000000000000

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.