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 27, 2024 16:48Hal FHal FScore: 57,012Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 16:4854,493328,561,792267,018,02002,277,376
2Apr 27, 2024 16:4854,572331,474,787267,402,12302,273,280
3Apr 27, 2024 16:4855,365339,258,764271,288,66402,285,568
4Apr 27, 2024 16:4856,459300,940,140273,655,0002,996,0002,289,664
5Apr 27, 2024 16:4856,559304,485,675275,140,0002,001,0002,289,664
6Apr 27, 2024 16:4856,864304,339,942276,636,0001,997,0002,289,664
7Apr 27, 2024 16:4857,012305,627,152277,359,0002,002,0002,289,664
8Apr 27, 2024 16:4857,029305,924,677277,438,0002,003,0002,269,184
9Apr 27, 2024 16:4857,065304,543,102277,620,0001,997,0002,289,664
10Apr 27, 2024 16:4857,456311,579,512280,534,0001,001,0002,289,664
11Apr 27, 2024 16:4857,563306,485,735279,060,0003,000,0002,269,184
12Apr 27, 2024 16:4860,615324,437,241295,014,0002,000,0002,265,088