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 listSep 22, 2022 12:19Bernard TeoBernard TeoScore: 81,309Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 22, 2022 12:1977,809450,558,802381,264,31002,265,088
2Sep 22, 2022 12:1977,852439,516,630381,476,55202,265,088
3Sep 22, 2022 12:1978,535451,546,823384,822,33202,269,184
4Sep 22, 2022 12:1981,275423,665,988397,249,0001,000,0002,408,448
5Sep 22, 2022 12:1981,304422,416,856397,390,0001,000,0002,387,968
6Sep 22, 2022 12:1981,308422,800,504396,412,0001,997,0002,281,472
7Sep 22, 2022 12:1981,309427,490,552397,412,0001,001,0002,400,256
8Sep 22, 2022 12:1981,320425,368,826398,466,00002,404,352
9Sep 22, 2022 12:1981,322430,432,155397,482,000998,0002,392,064
10Sep 22, 2022 12:1981,340423,035,010397,570,000998,0002,281,472
11Sep 22, 2022 12:1981,341422,636,032397,571,000998,0002,281,472
12Sep 22, 2022 12:1981,363420,400,757396,682,0001,998,0002,281,472