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 listApr 25, 2024 22:17Hal FHal FScore: 55,543Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2024 22:1754,963298,310,671267,318,0002,002,0002,285,568
2Apr 25, 2024 22:1755,033300,048,929266,665,0002,996,0002,285,568
3Apr 25, 2024 22:1755,106292,782,273268,020,0002,000,0002,285,568
4Apr 25, 2024 22:1755,152297,218,247267,242,0003,002,0002,285,568
5Apr 25, 2024 22:1755,436298,924,877268,641,0002,995,0002,269,184
6Apr 25, 2024 22:1755,451296,438,363268,715,0002,996,0002,281,472
7Apr 25, 2024 22:1755,543294,303,157269,161,0003,001,0002,273,280
8Apr 25, 2024 22:1755,746348,609,092273,157,36802,285,568
9Apr 25, 2024 22:1755,794333,557,462273,388,49402,277,376
10Apr 25, 2024 22:1755,827329,424,597273,551,68402,273,280
11Apr 25, 2024 22:1756,048305,264,216272,639,0001,997,0002,285,568
12Apr 25, 2024 22:1757,142301,086,415276,998,0002,999,0002,285,568