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 27, 2024 16:38Joad NacerJoad NacerScore: 243,767Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 6, 2024 23:18243,5901,217,633,1301,192,593,000999,0002,416,640
2Dec 6, 2024 23:18243,6761,221,834,3551,194,011,00002,531,328
3Dec 6, 2024 23:18243,7111,217,009,8791,193,186,000999,0002,531,328
4Nov 27, 2024 16:38243,7511,216,127,6681,193,383,000999,0002,535,424
5Nov 27, 2024 16:38243,7541,219,320,4701,193,395,000999,0002,424,832
6Dec 6, 2024 23:18243,7591,216,903,5651,192,418,0001,999,0002,420,736
7Dec 6, 2024 23:18243,7601,218,909,0181,192,427,0001,999,0002,506,752
8Nov 27, 2024 16:38243,7611,216,054,9671,192,431,0001,999,0002,420,736
9Nov 27, 2024 16:38243,7631,215,660,3521,193,442,000999,0002,420,736
10Nov 27, 2024 16:38243,7671,218,086,4141,192,461,0001,999,0002,535,424
11Dec 6, 2024 23:18243,7711,217,122,0941,193,480,000999,0002,506,752
12Nov 27, 2024 16:38243,7721,218,811,3981,193,482,000999,0002,273,280
13Dec 6, 2024 23:18243,7741,219,387,0291,192,492,0001,999,0002,531,328
14Nov 27, 2024 16:38243,7931,218,758,6131,192,588,0001,999,0002,535,424
15Nov 27, 2024 16:38243,8091,218,846,6041,192,667,0001,999,0002,416,640
16Nov 27, 2024 16:38243,8241,224,213,2561,193,739,000999,0002,273,280
17Dec 6, 2024 23:18243,8891,224,523,0021,194,058,000999,0002,424,832
18Dec 6, 2024 23:18246,0511,231,777,2401,204,651,000999,0002,269,184