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 5, 2021 17:31Dmitry KashtanovDmitry KashtanovScore: 2,724,498Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 5, 2021 22:242,622,72212,919,897,37012,851,338,40202,256,896
2May 5, 2021 22:242,630,23012,948,824,00512,888,128,03602,244,608
3May 5, 2021 17:312,633,28612,968,961,01912,903,101,26802,252,800
4May 5, 2021 22:242,642,06313,009,509,42712,946,108,14502,248,704
5May 5, 2021 17:312,658,62113,091,818,17113,027,240,77102,252,800
6May 5, 2021 22:242,719,09413,381,209,79113,323,562,47302,248,704
7May 5, 2021 17:312,724,49813,410,597,81313,350,042,04602,248,704
8May 5, 2021 22:242,726,53813,418,465,76113,360,038,53702,252,800
9May 5, 2021 17:312,726,72513,427,066,56113,360,951,99602,252,800
10May 5, 2021 22:242,776,68513,662,712,13613,605,758,56302,248,704
11May 5, 2021 17:312,794,08113,748,395,57213,690,997,02102,236,416
12May 5, 2021 17:312,886,51914,205,533,67614,143,943,85002,244,608