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 listJun 14, 2024 06:16matsuoka-601matsuoka-601Score: 55,598Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 14, 2024 06:1655,109291,651,584268,033,0002,000,0002,420,736
2Jun 14, 2024 06:1655,154301,001,784267,252,0003,002,0002,293,760
3Jun 14, 2024 06:1655,155297,830,225267,258,0003,002,0002,293,760
4Jun 14, 2024 06:1655,179290,695,565269,374,0001,001,0002,416,640
5Jun 14, 2024 06:1655,241302,373,604268,683,0001,997,0002,441,216
6Jun 14, 2024 06:1655,533302,337,896270,112,0002,000,0002,293,760
7Jun 14, 2024 06:1655,598350,181,441272,431,75202,289,664
8Jun 14, 2024 06:1655,610331,454,673272,488,43802,277,376
9Jun 14, 2024 06:1655,612330,777,989272,497,43402,265,088
10Jun 14, 2024 06:1656,121295,694,137272,992,0001,999,0002,502,656
11Jun 14, 2024 06:1656,420306,476,834274,455,0002,003,0002,420,736
12Jun 14, 2024 06:1656,850306,664,663277,561,0001,002,0002,420,736