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 listNov 9, 2024 22:25E SequeiraE SequeiraScore: 2,988,962Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 9, 2024 22:252,979,15914,626,549,82114,471,949,000125,929,0002,281,472
2Nov 9, 2024 22:252,980,69614,638,604,17414,479,478,000125,934,0002,281,472
3Nov 9, 2024 22:252,982,12914,644,386,19414,471,506,000140,927,0002,281,472
4Nov 9, 2024 22:252,987,53214,671,562,35114,510,970,000127,938,0002,281,472
5Nov 9, 2024 22:252,988,96214,683,354,61214,504,984,000140,931,0002,281,472
6Nov 9, 2024 22:252,997,33514,722,074,23614,569,016,000117,927,0002,281,472
7Nov 9, 2024 22:253,012,50914,798,166,39214,642,356,000118,937,0002,289,664
8Nov 9, 2024 22:253,036,99714,911,813,21914,726,367,000154,919,0002,281,472
9Nov 9, 2024 22:253,092,92015,190,282,42715,017,386,000137,920,0002,281,472