QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 512 MB Puntuación total: 100

#11376. 咒语生成

Estadísticas

在魔法世界中,通过在字符串中隐藏各种禁忌词汇来达到某种法术效果是一种常见的现象。为了更好地应对非法使用法术的情况,这个国家的人民需要学习法术工艺,以帮助自己防御法术。

今天的课程是关于一个简单的法术生成器,它有两种模式:点击(Click)和按压(Press)。

对于每次点击,生成一个长度为 1 的法术需要 1 秒。

对于每次按压,你必须首先选择一个正整数 $x$,然后生成一个长度为 $10^x$ 的法术需要 $2^x$ 秒。

现在给定一些需要生成的法术长度,你需要计算生成每个法术所需的最短时间。

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 50000$),表示请求的总数。

接下来的每一行包含一个整数 $r$ ($1 \le r \le 10^{18}$),表示需要生成的每个法术的长度。

输出格式

输出 $T$ 行,每一行表示所需的最短时间。

样例

样例输入 1

5
23
61
62
114514
1919810

样例输出 1

7
13
14
106
474

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.