QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 1024 MB مجموع النقاط: 100

#14850. 微小比特

الإحصائيات

在大多数现代计算机中,无符号数存储在内存对齐的数据块中,这些数据块由位(bit)组成。根据大小的不同,一个存储单元可能被称为字(word)、字节(byte),甚至半字节(nybble)。

每种存储介质恰好占用 $b = 2^x$ 位数据,其中 $x$ 是某个非负整数。在 $b$ 位的字中,能存储的最小无符号数是 $0$,最大无符号数是 $2^b - 1$。

我们正在为一个嵌入式系统设计存储方案,其中存储中可能出现的最大数量是预先已知的。请计算我们应该为其分配多少位。

输入格式

  • 一行,包含一个整数 $n$($1 \le n \le 10^{18}$),表示我们需要存储的最大数量。

输出格式

输出我们需要分配用于存储 $n$ 的位数,该位数必须是 $2$ 的幂,后面根据单复数情况加上 " bit" 或 " bits"。

样例

输入样例 1

1

输出样例 1

1 bit

输入样例 2

37

输出样例 2

8 bits

输入样例 3

1100586419201

输出样例 3

64 bits

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.