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 9, 2021 12:37Yuriy LyfenkoYuriy LyfenkoScore: 107,730Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 12:37107,4071,051,531,337524,295,0001,997,0002,478,080
2Jul 9, 2021 12:37107,4811,058,983,377525,660,000999,0002,482,176
3Jul 9, 2021 12:37107,5821,049,357,811526,150,0001,000,0002,473,984
4Jul 9, 2021 12:37107,6131,058,254,354527,302,00002,482,176
5Jul 9, 2021 12:37107,6171,059,573,123527,325,00002,482,176
6Jul 9, 2021 12:37107,7261,055,326,200525,860,0001,999,0002,260,992
7Jul 9, 2021 12:37107,7301,062,531,590525,877,0001,999,0002,260,992
8Jul 9, 2021 12:37107,9321,055,327,117527,869,000999,0002,482,176
9Jul 9, 2021 12:37107,9681,060,167,352529,041,00002,478,080
10Jul 9, 2021 12:37109,0161,083,260,126534,178,34002,211,840
11Jul 9, 2021 12:37109,0521,105,556,792534,356,26402,195,456
12Jul 9, 2021 12:37109,0641,094,880,174534,414,04702,195,456