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 listJul 1, 2021 09:40gchebanovgchebanovScore: 188,959Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 1, 2021 09:40151,722816,719,702743,436,96002,269,184
2Jul 1, 2021 09:40152,053814,006,454745,061,30502,265,088
3Jul 1, 2021 09:40153,897825,118,887754,096,22802,252,800
4Jul 1, 2021 09:40188,846954,279,222923,348,0001,998,0002,392,064
5Jul 1, 2021 09:40188,853960,915,892922,381,0002,997,0002,523,136
6Jul 1, 2021 09:40188,904963,728,388923,631,0001,999,0002,527,232
7Jul 1, 2021 09:40188,959952,021,573924,902,000999,0002,400,256
8Jul 1, 2021 09:40189,047955,095,430924,331,0001,998,0002,441,216
9Jul 1, 2021 09:40189,048959,326,069925,338,000999,0002,404,352
10Jul 1, 2021 09:40189,355950,601,662927,839,00002,428,928
11Jul 1, 2021 09:40189,417954,442,380925,145,0002,997,0002,527,232
12Jul 1, 2021 09:40189,492956,268,162927,513,000999,0002,408,448