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 28, 2024 21:19Hal FHal FScore: 54,698Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:1954,353288,281,683265,327,0001,005,0002,269,184
2Apr 28, 2024 21:1954,376291,547,528265,443,0001,001,0002,531,328
3Apr 28, 2024 21:1954,381293,700,949264,466,0002,003,0002,519,040
4Apr 28, 2024 21:1954,412289,800,586263,625,0002,995,0002,527,232
5Apr 28, 2024 21:1954,474289,030,763264,923,0001,999,0002,367,488
6Apr 28, 2024 21:1954,487290,022,742264,988,0001,999,0002,289,664
7Apr 28, 2024 21:1954,698291,300,650265,020,0003,000,0002,273,280
8Apr 28, 2024 21:1954,964296,180,456267,324,0002,002,0002,523,136
9Apr 28, 2024 21:1955,697300,310,566269,916,0002,999,0002,269,184
10Apr 28, 2024 21:1955,979330,571,507274,295,60902,273,280
11Apr 28, 2024 21:1956,251336,075,224275,631,24102,273,280
12Apr 28, 2024 21:1956,323337,702,055275,981,54702,277,376