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:43Hal FHal FScore: 55,369Success
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:4354,653337,621,392267,801,63102,273,280
2Apr 25, 2024 22:4354,784347,137,602268,442,68402,285,568
3Apr 25, 2024 22:4354,925294,688,832267,131,0002,000,0002,514,944
4Apr 25, 2024 22:4355,047325,805,066269,732,41002,281,472
5Apr 25, 2024 22:4355,050296,618,413266,747,0002,997,0002,277,376
6Apr 25, 2024 22:4355,106293,511,147268,020,0002,000,0002,269,184
7Apr 25, 2024 22:4355,369294,330,677270,309,0001,001,0002,269,184
8Apr 25, 2024 22:4355,390302,318,418269,410,0002,003,0002,531,328
9Apr 25, 2024 22:4355,440294,300,136270,660,000998,0002,269,184
10Apr 25, 2024 22:4355,448295,087,688271,695,00002,285,568
11Apr 25, 2024 22:4356,392303,867,523274,319,0002,002,0002,285,568
12Apr 25, 2024 22:43101,206519,174,119493,908,0001,999,0002,527,232