CF986D.Perfect Encoding

NOI/NOI+/CTSC

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

You are working as an analyst in a company working on a new system for big data storage. This system will store nn different objects. Each object should have a unique ID.

To create the system, you choose the parameters of the system — integers m≥1m \ge 1 and b1,b2,…,bmb_{1}, b_{2}, \ldots, b_{m}. With these parameters an ID of some object in the system is an array of integers [a1,a2,…,am][a_{1}, a_{2}, \ldots, a_{m}] where 1≤ai≤bi1 \le a_{i} \le b_{i} holds for every 1≤i≤m1 \le i \le m.

Developers say that production costs are proportional to ∑i=1mbi\sum_{i=1}^{m} b_{i}. You are asked to choose parameters mm and bib_{i} so that the system will be able to assign unique IDs to nn different objects and production costs are minimized. Note that you don't have to use all available IDs.

你是一家致力于开发新型大数据存储系统公司的分析师。该系统将存储 nn 个不同的对象,每个对象必须具有唯一的 ID。

为构建该系统,你需要选定系统参数——整数 m≥1m \ge 1 和 b1,b2,…,bmb_{1}, b_{2}, \ldots, b_{m}。在这些参数下,系统中某个对象的 ID 是一个整数数组 [a1,a2,…,am][a_{1}, a_{2}, \ldots, a_{m}],其中对每个 1≤i≤m1 \le i \le m 均满足 1≤ai≤bi1 \le a_{i} \le b_{i}。

开发人员指出,生产成本与 ∑i=1mbi\sum_{i=1}^{m} b_{i} 成正比。你的任务是选择参数 mm 和 bib_{i},使得系统能够为 nn 个不同对象分配唯一的 ID,同时使生产成本最小化。注意:你无需用尽所有可能的 ID。

输入格式

In the only line of input there is one positive integer nn. The length of the decimal representation of nn is no greater than 1.5⋅1061.5 \cdot 10^{6}. The integer does not contain leading zeros.

输入仅有一行,包含一个正整数 nn。nn 的十进制表示的长度不超过 1.5⋅1061.5 \cdot 10^{6}。该整数不含前导零。

输出格式

Print one number — minimal value of ∑i=1mbi\sum_{i=1}^{m} b_{i}.

输出一个数字——∑i=1mbi\sum_{i=1}^{m} b_{i} 的最小值。

输入输出样例

  • 输入#1

    36

    输出#1

    10
  • 输入#2

    37

    输出#2

    11
  • 输入#3

    12345678901234567890123456789

    输出#3

    177

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

首页