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 n different objects. Each object should have a unique ID.
To create the system, you choose the parameters of the system — integers m≥1 and b1,b2,…,bm. With these parameters an ID of some object in the system is an array of integers [a1,a2,…,am] where 1≤ai≤bi holds for every 1≤i≤m.
Developers say that production costs are proportional to ∑i=1mbi. You are asked to choose parameters m and bi so that the system will be able to assign unique IDs to n different objects and production costs are minimized. Note that you don't have to use all available IDs.
你是一家致力于开发新型大数据存储系统公司的分析师。该系统将存储 n 个不同的对象,每个对象必须具有唯一的 ID。
为构建该系统,你需要选定系统参数——整数 m≥1 和 b1,b2,…,bm。在这些参数下,系统中某个对象的 ID 是一个整数数组 [a1,a2,…,am],其中对每个 1≤i≤m 均满足 1≤ai≤bi。
开发人员指出,生产成本与 ∑i=1mbi 成正比。你的任务是选择参数 m 和 bi,使得系统能够为 n 个不同对象分配唯一的 ID,同时使生产成本最小化。注意:你无需用尽所有可能的 ID。
输入格式
In the only line of input there is one positive integer n. The length of the decimal representation of n is no greater than 1.5⋅106. The integer does not contain leading zeros.
输入仅有一行,包含一个正整数 n。n 的十进制表示的长度不超过 1.5⋅106。该整数不含前导零。
输出格式
Print one number — minimal value of ∑i=1mbi.
输出一个数字——∑i=1mbi 的最小值。
输入输出样例
输入#1
36
输出#1
10
输入#2
37
输出#2
11
输入#3
12345678901234567890123456789
输出#3
177
输入解题思路,AI测评打分。不知道怎么写?