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 listMay 26, 2021 21:41Mikhail DektyarevMikhail DektyarevScore: 207,817Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 26, 2021 21:14204,9051,047,642,6381,004,034,22002,232,320
2May 26, 2021 21:41205,1291,047,861,4071,005,132,66702,236,416
3May 26, 2021 21:14205,2861,043,741,7681,005,901,19802,228,224
4May 26, 2021 21:41207,8171,072,737,9291,018,304,17802,232,320
5May 26, 2021 21:14208,7341,087,069,2361,022,798,81302,232,320
6May 26, 2021 21:41212,0251,079,959,8521,038,920,53602,228,224