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 listJul 9, 2021 12:30Yuriy LyfenkoYuriy LyfenkoScore: 120,352Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 12:30120,0991,115,027,730586,488,0001,998,0002,490,368
2Jul 9, 2021 12:30120,1511,115,091,159586,743,0001,999,0002,490,368
3Jul 9, 2021 12:30120,1631,113,298,388587,802,000999,0002,494,464
4Jul 9, 2021 12:30120,2011,122,771,370588,986,00002,494,464
5Jul 9, 2021 12:30120,2681,116,905,545588,315,0001,000,0002,490,368
6Jul 9, 2021 12:30120,3101,120,589,534588,518,000999,0002,490,368
7Jul 9, 2021 12:30120,3521,115,145,851587,724,0001,999,0002,490,368
8Jul 9, 2021 12:30120,4001,117,934,657588,963,000999,0002,494,464
9Jul 9, 2021 12:30120,4311,120,815,451590,114,00002,490,368
10Jul 9, 2021 12:30133,0281,218,248,458651,836,41702,203,648
11Jul 9, 2021 12:30133,1031,237,245,548652,203,06702,203,648
12Jul 9, 2021 12:30133,3771,208,468,639653,547,74702,211,840