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 listJun 6, 2021 23:00Yuriy LyfenkoYuriy LyfenkoScore: 140,262Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 6, 2021 23:00131,8991,178,817,294645,306,000998,0002,371,584
2Jun 6, 2021 23:01134,5541,185,198,759658,317,0001,000,0002,510,848
3Jun 6, 2021 23:00134,6371,190,386,799658,722,000999,0002,371,584
4Jun 6, 2021 23:00134,6511,189,654,062657,791,0001,999,0002,371,584
5Jun 6, 2021 23:01135,1971,187,059,619660,469,0001,998,0002,375,680
6Jun 6, 2021 23:01135,3941,192,317,018662,431,000999,0002,506,752
7Jun 6, 2021 23:00135,8541,192,077,262663,688,0001,999,0002,506,752
8Jun 6, 2021 23:01136,7671,193,390,383670,160,00002,514,944
9Jun 6, 2021 23:01137,0761,197,074,532669,671,0001,999,0002,506,752
10Jun 6, 2021 23:00139,0611,208,239,686681,397,00002,506,752
11Jun 6, 2021 23:00139,6841,210,696,763682,453,0001,998,0002,510,848
12Jun 6, 2021 23:00139,9321,208,077,646683,666,0001,999,0002,510,848
13Jun 6, 2021 23:01140,2621,216,025,799686,284,0001,000,0002,379,776
14Jun 6, 2021 23:00140,8801,218,966,786689,312,0001,000,0002,510,848
15Jun 6, 2021 23:00141,7031,222,503,311693,345,000999,0002,375,680
16Jun 6, 2021 23:01141,7831,220,384,862692,737,0001,999,0002,506,752
17Jun 6, 2021 23:01142,8281,226,969,557697,856,0001,999,0002,498,560
18Jun 6, 2021 23:01144,7851,242,180,460707,447,0001,998,0002,510,848
19Jun 6, 2021 23:00151,1461,304,125,347740,616,74102,228,224
20Jun 6, 2021 23:01152,2731,299,586,106746,135,55402,228,224
21Jun 6, 2021 23:00152,3821,303,824,208746,673,01102,228,224
22Jun 6, 2021 23:01152,6911,320,312,122748,183,84902,228,224
23Jun 6, 2021 23:00153,8601,322,141,937753,915,52002,228,224
24Jun 6, 2021 23:01158,0031,341,878,983774,212,72902,236,416