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 6, 2025 12:02Aniruddha DebAniruddha DebScore: 785,645Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 6, 2025 12:02785,5993,875,056,4463,848,435,000999,0002,531,328
2Apr 6, 2025 12:02785,6003,875,670,1333,848,442,000999,0002,269,184
3Apr 6, 2025 12:02785,6123,878,512,8263,848,499,000999,0002,424,832
4Apr 6, 2025 12:02785,6203,871,280,9553,848,538,000999,0002,510,848
5Apr 6, 2025 12:02785,6453,871,228,7403,849,662,00002,531,328
6Apr 6, 2025 12:02785,7773,878,237,0823,848,309,0001,998,0002,269,184
7Apr 6, 2025 12:02785,7923,887,212,9643,849,384,000999,0002,269,184
8Apr 6, 2025 12:02785,8453,874,113,6863,848,642,0001,998,0002,269,184
9Apr 6, 2025 12:02788,6453,890,124,0933,862,362,0001,998,0002,269,184