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 4, 2025 07:08Advait IyerAdvait IyerScore: 655,033Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 11, 2025 16:09654,8613,247,093,5973,204,823,0003,997,0002,551,808
2Jan 11, 2025 16:09654,9193,240,070,7393,206,103,0002,998,0002,387,968
3Jan 11, 2025 16:09654,9423,239,557,1823,204,220,0004,997,0002,428,928
4Jan 11, 2025 16:09654,9433,238,655,6043,206,221,0002,998,0002,433,024
5Jan 11, 2025 16:09654,9513,243,423,1443,206,265,0002,997,0002,433,024
6Jan 11, 2025 16:09654,9953,237,963,0123,207,476,0001,999,0002,424,832
7Jan 11, 2025 16:10655,0033,244,094,3673,206,518,0002,997,0002,363,392
8Jan 11, 2025 16:10655,0333,242,558,2673,205,663,0003,997,0002,359,296
9Jan 11, 2025 16:09655,0513,244,069,6643,206,751,0002,997,0002,523,136
10Jan 11, 2025 16:09655,2283,245,317,5783,207,620,0002,998,0002,478,080
11Jan 11, 2025 16:09655,2743,240,707,0093,205,849,0004,996,0002,387,968
12Apr 4, 2025 07:08655,7973,244,024,7663,206,410,0006,996,0002,560,000
13Apr 4, 2025 07:08656,0623,248,815,4603,206,708,0007,994,0002,375,680
14Apr 4, 2025 07:08656,2203,246,295,0453,206,483,0008,995,0002,387,968
15Jan 11, 2025 16:10659,5313,257,796,9923,228,706,0002,998,0002,387,968