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 listMar 8, 2024 03:08Huy Duc LeHuy Duc LeScore: 162,178Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 8, 2024 03:08147,886797,813,835724,643,44202,265,088
2Mar 8, 2024 03:08149,335797,252,079731,743,45002,269,184
3Mar 8, 2024 03:08150,261794,393,929736,279,84602,273,280
4Mar 8, 2024 03:08161,402817,368,513674,890,000115,981,0002,269,184
5Mar 8, 2024 03:08161,662818,439,599686,125,000106,019,0002,281,472
6Mar 8, 2024 03:08162,146822,674,567679,587,000114,930,0002,277,376
7Mar 8, 2024 03:08162,178820,030,119684,716,000109,954,0002,277,376
8Mar 8, 2024 03:08163,564827,067,812679,548,000121,918,0002,383,872
9Mar 8, 2024 03:08163,603824,744,577711,692,00089,961,0002,281,472
10Mar 8, 2024 03:08163,834825,561,987608,839,000193,948,0002,273,280
11Mar 8, 2024 03:08164,426837,310,625676,738,000128,950,0002,269,184
12Mar 8, 2024 03:08166,574841,181,749707,183,000109,028,0002,273,280