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 listApr 28, 2024 21:28Hal FHal FScore: 56,423Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:2856,216347,458,830275,457,15502,269,184
2Apr 28, 2024 21:2856,304342,680,931275,889,84802,273,280
3Apr 28, 2024 21:2856,312343,680,595275,926,41902,277,376
4Apr 28, 2024 21:2856,326299,552,413274,998,000999,0002,289,664
5Apr 28, 2024 21:2856,346296,509,573273,095,0003,001,0002,265,088
6Apr 28, 2024 21:2856,376298,772,223274,241,0002,001,0002,269,184
7Apr 28, 2024 21:2856,423305,193,571274,470,0002,003,0002,289,664
8Apr 28, 2024 21:2856,429300,922,408274,501,0002,003,0002,289,664
9Apr 28, 2024 21:2856,459306,000,651274,650,0001,997,0002,531,328
10Apr 28, 2024 21:2856,501299,200,032274,856,0001,998,0002,281,472
11Apr 28, 2024 21:2856,508302,006,864275,889,000999,0002,396,160
12Apr 28, 2024 21:2856,518303,224,868273,938,0002,999,0002,289,664