Format integers Sergey Svistunov

Compute a checksum over the decimal representations of binary integers as fast as possible.

Input: 250 000 000 uint32 values in little-endian binary on STDIN (4 bytes each).

Output: A uint64 checksum computed as:

CRC = sum of number_crc(n) for each n

where number_crc(n) converts n to its decimal string and sums ascii(digit) * position over each digit (0-indexed from the left).

Example: For n = 42, the decimal string is "42", so number_crc(42) = ascii('4') * 0 + ascii('2') * 1 = 52 * 0 + 50 * 1 = 50.

Back to listMay 20, 2021 05:12Yuriy LyfenkoYuriy LyfenkoScore: 101,594Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2021 05:4397,583544,918,280478,156,47102,220,032
2May 20, 2021 05:1397,643535,052,830478,451,68202,228,224
3May 20, 2021 05:1398,004537,373,720480,221,26502,228,224
4May 20, 2021 05:5098,024557,658,611480,317,33002,228,224
5May 20, 2021 05:1298,048545,316,246480,433,32902,220,032
6May 20, 2021 05:1398,293550,524,191481,634,25402,228,224
7May 20, 2021 05:1399,266552,246,173486,400,98702,232,320
8May 23, 2021 14:0499,566552,378,968487,874,45502,232,320
9May 20, 2021 05:13100,323569,366,790491,582,66102,224,128
10May 23, 2021 14:04100,429554,079,964492,102,30702,228,224
11May 20, 2021 05:50100,843552,018,956494,129,56802,232,320
12May 20, 2021 05:50100,912555,459,331494,468,57502,215,936
13May 20, 2021 05:43101,132550,513,361495,545,25102,265,088
14May 20, 2021 05:50101,594577,316,902497,811,62302,224,128
15May 23, 2021 14:04101,655568,847,050498,108,94602,220,032
16May 20, 2021 05:13102,009561,714,243499,846,40902,224,128
17May 20, 2021 05:50102,669559,203,470503,080,50902,224,128
18May 20, 2021 05:13102,980571,539,672504,601,85802,228,224
19May 20, 2021 05:13103,115564,915,751505,262,44002,228,224
20May 20, 2021 05:50103,132567,239,197505,347,80802,220,032
21May 20, 2021 05:12103,162560,755,815505,492,43902,215,936
22May 20, 2021 05:50103,441570,664,268506,860,68702,220,032
23May 20, 2021 05:50103,530573,355,728507,298,45202,232,320
24May 20, 2021 05:43103,688568,522,058508,071,66602,236,416
25May 20, 2021 05:13104,341598,008,970511,270,62602,224,128
26May 20, 2021 05:50105,385592,133,843516,385,70502,220,032
27May 20, 2021 05:12107,006589,669,036524,327,20902,224,128