UVA Skew Binary
来源:互联网 发布:js给input赋值 编辑:程序博客网 时间:2024/06/02 03:10
Skew Binary
When a number is expressed in decimal, the k-th digit represents a multiple of 10k. (Digits are numbered from right to left, where the least significant digit is number 0.) For example,
When a number is expressed in binary, the k-th digit represents a multiple of 2k. For example,
In skew binary, the k-th digit represents a multiple of 2k+1 - 1. The only possible digits are 0 and 1, except that the least-significant nonzero digit can be a 2. For example,
The first 10 numbers in skew binary are 0, 1, 2, 10, 11, 12, 20, 100, 101, and 102. (Skew binary is useful in some applications because it is possible to add 1 with at most one carry. However, this has nothing to do with the current problem.)
Input
The input file contains one or more lines, each of which contains an integer n. If n = 0 it signals the end of the input, and otherwise n is a nonnegative integer in skew binary.Output
For each number, output the decimal equivalent. The decimal value of n will be at most 2 31 - 1 = 2147483647.Sample Input
1012020000000000000000000000000000010100000000000000000000000000000011100111110000011100001011011020000
Sample Output
44214748364632147483647471041110737
Miguel A. Revilla
1998-03-10
题意:讲给出的二进制数转换成十进制的数
代码:
- uva 575Skew Binary
- uva 575 - Skew Binary
- Uva 575 - Skew Binary
- uva 575 - Skew Binary
- UVa 575 Skew Binary
- uva 575 Skew Binary
- UVa 575Skew Binary
- uva 575 - Skew Binary
- uva 575 Skew Binary
- UVa 575 - Skew Binary
- UVa 575 - Skew Binary
- uva 575 - Skew Binary
- UVa 575 - Skew Binary
- UVA - 575 - Skew Binary
- UVA 575-Skew Binary
- UVA - 575 Skew Binary
- UVA - 575 Skew Binary
- UVA - 575 Skew Binary
- 根据SID找出当前用户正在执行的SQL
- wikioi 1275 有鱼的声音
- zImage和uImage的区别
- Volatile修饰的变量
- oracle判断一个字符串中是否包含另外一个字符串
- UVA Skew Binary
- Smarty学习笔记
- 移植ssh到arm
- JSON简要-来自百科
- vijos p1005 奶牛浴场[ 极大化思想]
- C++函数新特征与递归函数
- SZU 2015 Winter Training Day#2
- UVA Multiplying by Rotation
- HDUOJ-1001: 计算从1到n的和