当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
Definitions | For example |
The first of a pair of numbers is denoted by F. | in "18482-02", F = 18482 |
The second of a pair of numbers (in compressed form) is denoted by C. | in "18482-02", C = 02 |
The second of a pair of numbers (in decoded form) is denoted by R. | in "18482-02", R = 18502 |
MSD(x,y) refers to the 'x' most significant digits of 'y' when 'y' is denoted in base ten, which is the null string for x <= 0 | MSD(3,19283) = 192, MSD(0,12)='' |
LSD(x,y) refers to the 'x' least significant digits of 'y' when 'y' is denoted in base ten (possibly padded with zeros). | LSD(2, 48290) = 90, LSD(2,3)= 03 |
Rule | An example |
The number C is always written with the fewest possible digits. | |
If the number C is larger than F, then R is the same as C. | given "123-283", then F=123, C=283, and R would be 283 |
If C is less than or equal to F, then the following rules apply: | |
LSD(length(C), R) will always be the same as C. | |
If LSD(length(C), F) is less than C, then R is equal to MSD(length(F) - length(C), F), prepended to the digits of C. | given: "4137-223", then: F=4137, C=223: LSD(length(C),R) = 223 MSD(4 - 3, 4137) = 4 R would be 4223 |
If LSD(length(C), F) is greater than or equal to C, then R is equal to 10^(length(C)) added to the following value: MSD(length(F) - length(C), F), prepended to the digits of C. | given: "8543-13", then F=8543, C=13: LSD(length(C),R) = 13 MSD(4 - 2, 8543) = 85 10^(2) = 100 R would be 8513 + 100 = 8613 |
given: "2839-06", then F=2839, C=06 so R would be 2906
given: "2839-006", then F=2839, C=006 so R would be 3006
10-18 83294-84137 100-200
10-8 83294-137 100-00
时间上限 | 内存上限 |
1000 | 65536 |