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 10, 2025 12:19Advait IyerAdvait IyerScore: 1,247,648Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 10, 2025 12:191,246,2156,136,190,3355,991,519,000114,933,0002,277,376
2Jan 10, 2025 12:191,246,6096,139,466,2985,985,435,000122,947,0002,277,376
3Jan 10, 2025 12:191,246,6776,135,529,5055,966,795,000141,923,0002,289,664
4Jan 10, 2025 12:191,247,0586,139,431,0316,004,646,000105,940,0002,289,664
5Jan 10, 2025 12:191,247,6486,143,634,1626,003,537,000109,936,0002,277,376
6Jan 10, 2025 12:191,248,8866,150,017,8696,010,601,000108,938,0002,277,376
7Jan 10, 2025 12:191,250,1266,152,348,1955,996,690,000128,928,0002,277,376
8Jan 10, 2025 12:191,255,0836,178,923,1096,034,966,000114,942,0002,269,184
9Jan 10, 2025 12:191,260,4926,205,638,2226,021,501,000154,909,0002,277,376