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 31, 2024 04:19matsuoka-601matsuoka-601Score: 66,509Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 31, 2024 04:1964,258377,615,351314,863,32102,207,744
2Jul 31, 2024 04:1964,275391,425,312314,948,80102,199,552
3Jul 31, 2024 04:1966,158389,926,832324,174,71802,203,648
4Jul 31, 2024 04:1966,485346,944,108322,778,0002,997,0002,310,144
5Jul 31, 2024 04:1966,488349,067,831323,795,0001,998,0002,457,600
6Jul 31, 2024 04:1966,499348,866,327323,848,0001,999,0002,285,568
7Jul 31, 2024 04:1966,509348,530,148322,894,0002,999,0002,293,760
8Jul 31, 2024 04:1966,513349,598,617322,917,0002,999,0002,310,144
9Jul 31, 2024 04:1966,515352,601,503322,926,0002,999,0002,465,792
10Jul 31, 2024 04:1966,517354,771,337322,934,0002,999,0002,293,760
11Jul 31, 2024 04:1966,530349,145,224322,999,0002,999,0002,293,760
12Jul 31, 2024 04:1970,298371,949,913342,460,0002,002,0002,453,504