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 listJan 6, 2024 16:30matsuoka-601matsuoka-601Score: 76,862Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 6, 2024 16:3074,319439,297,047364,164,37702,277,376
2Jan 6, 2024 16:3074,376430,433,276364,440,06402,269,184
3Jan 6, 2024 16:3076,801398,930,922375,325,0001,000,0002,527,232
4Jan 6, 2024 16:3076,802398,282,718374,330,0002,001,0002,269,184
5Jan 6, 2024 16:3076,847403,067,470374,551,0001,997,0002,285,568
6Jan 6, 2024 16:3076,857402,995,127373,604,0002,996,0002,273,280
7Jan 6, 2024 16:3076,862402,545,257373,628,0002,997,0002,281,472
8Jan 6, 2024 16:3076,878408,213,000374,703,0001,998,0002,523,136
9Jan 6, 2024 16:3076,901400,202,162373,817,0002,998,0002,531,328
10Jan 6, 2024 16:3077,085404,631,145374,721,0002,997,0002,527,232
11Jan 6, 2024 16:3078,446450,540,214384,385,59702,256,896
12Jan 6, 2024 16:3078,848416,875,747385,354,0001,000,0002,285,568