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 20, 2022 17:41Bernard TeoBernard TeoScore: 72,470Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 20, 2022 17:4172,374379,022,880354,632,00002,396,160
2Sep 20, 2022 17:4172,377381,589,109353,646,000999,0002,400,256
3Sep 20, 2022 17:4072,381376,620,251352,668,0001,998,0002,392,064
4Sep 20, 2022 17:4072,382381,931,216352,672,0001,998,0002,281,472
5Sep 20, 2022 17:4072,383381,093,215353,676,000999,0002,281,472
6Sep 20, 2022 17:4172,384378,747,456352,682,0001,998,0002,400,256
7Sep 20, 2022 17:4172,393377,556,643353,729,000999,0002,281,472
8Sep 20, 2022 17:4072,401377,608,292352,766,0001,998,0002,400,256
9Sep 20, 2022 17:4072,411384,238,761352,814,0001,998,0002,281,472
10Sep 20, 2022 17:4172,431383,882,018352,912,0001,999,0002,281,472
11Sep 20, 2022 17:4172,439384,696,442353,952,000999,0002,281,472
12Sep 20, 2022 17:4072,455381,027,378354,029,0001,000,0002,281,472
13Sep 20, 2022 17:4172,470377,984,206354,102,0001,000,0002,281,472
14Sep 20, 2022 17:4072,472381,701,722353,112,0002,000,0002,281,472
15Sep 20, 2022 17:4072,488386,084,462353,194,0001,995,0002,281,472
16Sep 20, 2022 17:4172,498387,439,395355,241,00002,281,472
17Sep 20, 2022 17:4172,594380,253,357353,715,0001,998,0002,387,968
18Sep 20, 2022 17:4075,158390,376,074368,273,00002,392,064
19Sep 20, 2022 17:4075,845444,572,107371,642,80902,265,088
20Sep 20, 2022 17:4175,848450,009,936371,654,43802,269,184
21Sep 20, 2022 17:4075,896446,265,982371,888,38202,269,184
22Sep 20, 2022 17:4075,897438,030,709371,893,79602,269,184
23Sep 20, 2022 17:4175,977447,426,413372,288,55302,273,280
24Sep 20, 2022 17:4176,134442,964,944373,054,62602,265,088